Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

Avoid Blank Lines at End of a Text File with PowerShell

Summary: Microsoft Scripting Guy Ed Wilson teaches how to avoid writing blank lines at the end of a file by using Windows PowerShell.   (image) Hey, Scripting Guy! I have a problem with my script. For example, in my script, I build up a variable. Then when I write the variable to a file, I always end up with an extra blank line at the end...

Restore NTFS Security Permissions by Using PowerShell

Summary: Superhero BATCHman restores NTFS security permissions using Windows PowerShell.   Microsoft Scripting Guy Ed Wilson here. Well, it is time once again for BATCHman. This time, it is Episode 12. Take it away, Sean. (image) When the digital crash In a blink and a splash A gleam in the night To make all wrongs right Our heroes fly ...

Use PowerShell and Regular Expressions to Parse Handle Output

Summary: Windows PowerShell superhero BATCHman uses regular expressions to parse output from handle.   Microsoft Scripting Guy Ed Wilson here. Today we have Episode 10 of the BATCHman series.  (image) Whenever trouble happens in systems and people will call, and darkness rolls out causing your fall, Creatures of bits roam in the ...