Scripting Blog [archived]

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

PowerTip: Redirect PowerShell Warning Messages to a Text File

Summary: Use the warning redirection operator to redirect Windows PowerShell warning messages to a text file. (image)  How can you prevent warning messages from displaying to the Windows PowerShell host, but instead capture them in a text file? (image)  Use the warning message redirection operator: $WarningPreference = "continue" &...

Use PowerShell Redirection Operators for Script Flexibility

Summary: Microsoft Scripting Guy Ed Wilson talks about using the new Windows PowerShell redirectioin operators to add flexibility to a script. (image)  Hey, Scripting Guy! There is something about Windows PowerShell that I don’t get. Normally, I can use the redirection arrows to write to a text file, but sometimes it does not work...

Use PowerShell to Create Intelligent Default Values

Summary: Windows PowerShell 3.0 introduces the PSDefaultParameterValues automatic variable, which permits creating custom default values. Microsoft Scripting Guy, Ed Wilson, is here. Life is returning to normal—at least for this week. Next week, the Scripting Wife and I head north where I will be speaking at the Central Ohio ...