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
PowerTip: Find a module in the PowerShell Gallery
Summary: Use the PowerShell Find module to search for modules. I was trying to use the Find-module. Can you show me how to find all modules that have the word, Azure, in them? Just use a wildcard in the search like in the following example to return modules with the name Azure in the beginning:
Work with the Azure Resource Manager cmdlets – Part 1
Summary: Obtain and install the AzureRM cmdlets. This blog post is part of a series about how to work with the Azure Resource Manager cmdlets. To get the most out of this series, read the posts in order. After you finish this series, move on to the next two series to learn more about the Azure Resource Manager cmdlets. I heard Microsoft introduced some new cmdlets to work with Azure Resource Manager. Could you show me how I could install them? Honorary Scripting Guy, Sean Kearney, is here today to introduce you to the newest cmdlets to manage the Azure Resource Manager environment. Most o...
The Scripting Guys and Scripting Wife summer tour
SUMMARY: Ed Wilson talks about his summer of PowerShell tour with dates and links to live appearances. Hello everyone, Hope you are having a fantastic day. Ed and I have been busy as usual and are ready to get busier. Here are the dates and links to upcoming events we will be attending and Ed speaking. There is a trip to Europe that some items are planned and have a link and others that are on the planning board. We will post links as they are available but for now I will just reference the city/country and for the link I will just write to be determined. Hope to see you at one of these events. May 23...
The top three tips for effective sorting in PowerShell
Summary: Learn the top three tips to effectively use Windows PowerShell to sort data in this blog post by the Microsoft Scripting Guy, Ed Wilson. One of the fundamental things that I need to do when I look at any kind of data is sort it so that I can make sense of what I am looking at. It doesn’t matter if I am looking at Yelp for restaurant recommendations (I want to sort by distance from me and by average rating) or at my Facebook timeline (I want to sort by time, as in, when an update was posted). Yes, sorting is one thing that makes the difference between, say, looking for books at the library via the online...
PowerTip: Specify that a script requires admin privileges to run
Summary: Learn how to require admin privileges to run a Windows PowerShell script. How can I make sure that my Windows PowerShell script has administrator privileges to run? Use the #Requires directive and specify RunAsAdministrator. Here is an example:
How to answer a technical question: A guide for presenters
Summary: Learn how to properly answer a technical question in a presentation in this step-by-step post by PowerShell MVP June Blender. Today we have another blog post by PowerShell MVP June Blender. June is an Honorary Scripting Guy and a technical evangelist for the SAPIEN Technologies, Inc. She has been working with PowerShell for a long time. When she worked for Microsoft, she wrote the PowerShell help documentation. If you have ever used Get-Help in your life, more than likely you have seen some of her work. Take it away June … How to Answer a Technical Question Like many people, I look forward to the Power...
Use a script block to create custom groupings in PowerShell
Summary: Learn how to use a script block with the Group-Object cmdlet in Windows PowerShell to create custom groupings in this article by Microsoft Scripting Guy Ed Wilson. Good morning. Ed Wilson the Microsoft Scripting Guy is here. This week, I have been hanging out with a group of writers. It has been both fun and educational. It is always good to see how other people solve standard types of problems. As I look around, I can see nearly a dozen other writers huddled into little conversation groups as they discuss problems of craft. Anyway, with Windows PowerShell, there are also standard problems of craft wit...
Discover relationships by using Group-Object in PowerShell
Summary: Learn how to use one of the most basic Windows PowerShell cmdlets, the Group-Object cmdlet, to see relationships among different objects. There are some things in life that just seem to always go together: jasmine flowers and green tea, scones and English breakfast tea, or even peanut butter and apples. In the world of Windows PowerShell, there are things that go together as well. It seems that I always do the same kinds of things: For the next few days, I want to focus on the second and third items, grouping data and sorting data. Group-Object: A basic cmdlet No matter what I am doing with Wi...
PowerTip: Use PowerShell to display a percentage that has two decimal places
Summary: Use Windows PowerShell to display a percentage as a two place number. How can I use Windows PowerShell to display a number as a percentage that has two decimal places? Use the -f format specifier, and specify a pattern as “{0:p2}”. On the other side of the -f format specifier, perform your percentage calculation. Here is an example: PS C:\> "{0:p2}" -f (1/10) 10.00 %