The “Hey, Scripting Guys!” blog has been retired. There are many useful posts in this blog, so we keep the blog here for historical reference. However, some information might be very outdated and many of the links might not work anymore.
New PowerShell content is being posted to the PowerShell Community blog where members of the community can create posts by submitting content in the GitHub repository.
Scripting Blog [archived]
Formerly known as the "Hey, Scripting Guy!" blog
Latest posts

Fun with PowerShell Functions

Summary: Ed Wilson, Microsoft Scripting Guy, talks about basic design considerations for Windows PowerShell functions. Hey, Scripting Guy! I keep hearing about functions, but I really do not know what they are, how to create one, or even how to use one. Can you help me with this? I am not a programmer, but it seems likely that you guys are trying to force me to become one. Help! —DS Hello DS, Microsoft Scripting Guy, Ed Wilson, is here. It is another beautiful day here in Central Florida. I am sipping a nice cup of Djareerling tea, with a bit of orange blossom local honey, and munching on a hone...

PowerTip: Pick Up User Name with PowerShell

Summary: Use Windows PowerShell to easily pick up the user name. How can I easily pick up the user name from my Windows PowerShell script? Use the USERNAME environmental variable, and pick it up from the $env Windows PowerShell drive: $env:USERNAME

PowerTip: Use PowerShell to Get Unique List of Process Names

Summary: Use Windows PowerShell to get a list of unique process names. How can I use Windows PowerShell to obtain a list of all the unique process names running on my system? Use the Get-Process cmdlet, pipe the results to the Select-Object cmdlet, and specify the Name property and the –Unique switch: Get-Process | select name -Unique

A PowerShell Script Is…

Summary: Ed Wilson, Microsoft Scripting Guy, talks about creating and using a Windows PowerShell script. Microsoft Scripting Guy, Ed Wilson, is here. This afternoon, it is raining—actually more like a thunderstorm because there is lightning and thunder. In the afternoon in central Florida, there is a really good chance that for 10 or 15 minutes, one will see an awesome thunderstorm. I think the weather people always have a standard line: "Chance of afternoon thunderstorms"—and there is a good chance they will be right. Anyway, listening to Beethoven and watching a thunderstorm is awesome. I even decid...

PowerTip: Use PowerShell to Display Time in 24-Hour Format

Summary: Use Windows PowerShell to display the current time in 24-hour format. How can I use Windows PowerShell to display the current time in 24-hour format? Use the Get-Date cmdlet and the –UFormat parameter with %R: Get-Date -UFormat %R

PowerShell Scripting: The Terms

Summary: Ed Wilson, Microsoft Scripting Guy, talks about Windows PowerShell scripting terminology. Hey, Scripting Guy! So I am confused, and I am not afraid to admit that I am confused. In the old fashioned VBScript days, I wrote scripts. I could also write subroutines or functions. And that was about it. Pretty simple, and it made sense to me. But with Windows PowerShell, it seems that there is so much more, and I do not even know where to begin. Not to mention that I have not seen a single reference about how to create a subroutine in Windows PowerShell. What gives? Can you throw me a bone? —JT &nbs...

PowerTip: Get Time with PowerShell

Summary: Use Windows PowerShell to get the current time. How can I use Windows PowerShell to get the current time? Use the Get-Date cmdlet and specify a –DisplayHint of Time: Get-Date -DisplayHint time

Weekend Scripter: When to Write a PowerShell Script

Summary: Ed Wilson, Microsoft Scripting Guy, talks about when to write a Windows PowerShell script. Microsoft Scripting Guy, Ed Wilson, is here. I am enjoying a beautiful sunny morning in central Florida. The sun is shining, there is hardly a cloud in the sky, and a gentle ocean breeze tickles my skin. I am sitting outside under a beautiful, several-hundred year-old oak tree with Spanish moss that hangs to the ground from its bent branches. I mean, dude, if ZZ Top had a tree, it would look like this one. Anyway, I am sitting out here with an oversized cup of Darjeeling tea, a plate of freshly sliced locally grown...

PowerTip: Multiply Value in Variable and Store Results

Summary: Use Windows PowerShell to multiply the value stored in a variable and store the results. How can I use Windows PowerShell to multiply the value of a variable and store the results in the same variable? Use the *= operator, for example:PS C:> $a = 2PS C:> $a *= 3PS C:> $a6