Scripting Blog [archived]

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

Configure PowerShell Cmdlet Default Values by Using Splatting

Summary: Learn how to use the Windows PowerShell splatting feature to avoid typing repetitive cmdlet parameters.   (image) Hey, Scripting Guy! I am wondering if you can help me. There are some cmdlets that have a lot of parameters. I need to fill these parameters out in order to cause the cmdlet to work properly, but once I have figured ...

Send Email from Exchange Online by Using PowerShell

Summary: Guest blogger Mike Pfeiffer shows how to send email messages using Windows PowerShell and Exchange online.   Microsoft Scripting Guy Ed Wilson here. Guest Blogger Mike Pfeiffer recently published a book called Microsoft Exchange 2010 PowerShell Cookbook. Mike has been in the IT field for over 13 years, spending most of his time ...

Use PowerShell to Work with CSV Formatted Text

Summary: See how to use Windows PowerShell to create CSV files from formatted and unformatted text.   (image) Hey, Scripting Guy! I have begun to play around with Windows PowerShell, and it is absolutely the most confusing thing Microsoft has ever created. Simple things are easy. I can use Get-Process and Get-Service with no problem, but ...

Format Multilevel Arrays in PowerShell

Summary: Microsoft Scripting Guy Ed Wilson talks about formatting multilevel arrays in Windows PowerShell.   (image) Hey, Scripting Guy! I am having a problem with arrays. I have two-level arrays and they work perfectly when I have the arrays defined on a single line. But when I try to format my script so that it is easier to read, they ...

Two Simple PowerShell Methods to Remove the Last Letter of a String

Summary: Learn two simple Windows PowerShell methods to remove the last letter of a string.   (image) Hey, Scripting Guy! I have, what should be a simple question. I need to be able to remove only the last character from a string. For example, if I have a string the scripts, I want the string to be the script instead. If I have the number...