Scripting Blog [archived]

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

Weekend Scripter: Using Try, Catch, Finally Blocks for PowerShell Error Handling

Summary: Microsoft PFE, Ashley McGlone, talks about using Try, Catch, Finally blocks for error handling in Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Today’s guest blogger is Ashley McGlone, a Microsoft premier field engineer. Ashley is a popular speaker at our Windows PowerShell Saturday events. He regularly blogs ...

Clean Up Your PowerShell History to Remove Error Entries

Summary: Microsoft Scripting Guy, Ed Wilson, shows how to remove all error commands from your Windows PowerShell command history. Microsoft Scripting Guy, Ed Wilson, is here. One of the great things about being involved with a Windows PowerShell user group is all the great people I meet and all the cool ideas that arise. It seems that every ...

Query Active Directory and Ping Each Computer in the Domain by Using PowerShell

Summary: Query Active Directory and ping each computer in the domain by using Windows PowerShell. The Scripting Guys show you how.   (image) Hey, Scripting Guy! I am THE IT person at my company. I am also a chemical engineer who has daily production responsibilities in our process plant. You see, I am supposed to be a part-time IT person...

Hey, Scripting Guy! How Can I Use Try/Catch/Finally in Windows PowerShell?

(image)   (image) Hey, Scripting Guy! One thing I miss in Windows PowerShell is the ability to use a Try/Catch/Finally block that I can use in C#. To me it is an elegant solution to error handling. You attempt something, catch any resulting errors, and clean up the mess you made. Are there any plans in Windows PowerShell 3.0 to ...