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 top PowerShell cmdlet nouns
Summary: Learn how to find the top five nouns in Windows PowerShell cmdlets. How can I find which nouns are the most prevalent in Windows PowerShell cmdlets? You need to find all of the cmdlet names, group them by noun, sort them by count, and then select only the first five, for example: gcm * -CommandType cmdlet | group noun -noelement | sort count -Descending | select -First 5 Note gcm is an alias for Get-Command.
PowerTip: Use PowerShell to return first two lines of file
Summary: Learn how to use Windows PowerShell to return the first two lines of a text file. How can I use Windows PowerShell to easily return the first two lines of a text file? Use the Get-Content cmdlet and specify the TotalCount parameter. In this example, TotalCount is set to 2 and the file is named AMoreComplete.txt:Get-Content 'C:\fso\AMoreComplete.txt' -TotalCount 2
PowerTip: Use PowerShell to return first two lines of file
Summary: Learn how to use Windows PowerShell to return the first two lines of a text file. How can I use Windows PowerShell to easily return the first two lines of a text file? Use the Get-Content cmdlet and specify the TotalCount parameter. In this example, TotalCount is set to 2 and the file is named AMoreComplete.txt:Get-Content 'C:\fso\AMoreComplete.txt' -TotalCount 2
PowerTip: Find related cmdlet aliases
Summary: Learn how to find aliases related to a series of cmdlets. How can I find aliases that are related to a series of Windows PowerShell cmdlets, such as processes? Use the Get-Alias cmdlet and specify a wildcard character for the definition parameter, for example: Get-Alias -Definition "*process"
PowerTip: Find related cmdlet aliases
Summary: Learn how to find aliases related to a series of cmdlets. How can I find aliases that are related to a series of Windows PowerShell cmdlets, such as processes? Use the Get-Alias cmdlet and specify a wildcard character for the definition parameter, for example:Get-Alias -Definition "*process"
PowerTip: Find cmdlets and functions related to DSC
Summary: Use Windows PowerShell to find cmdlets and functions related to Desired State Configuration. How can I use Windows PowerShell to quickly find a list of cmdlets and functions related to Desired State Configuration (DSC)? Use the Get-Command cmdlet and specify a noun of *dsc*: Get-Command -Noun *DSC*
PowerTip: Find cmdlets and functions related to DSC
Summary: Use Windows PowerShell to find cmdlets and functions related to Desired State Configuration. How can I use Windows PowerShell to quickly find a list of cmdlets and functions related to Desired State Configuration (DSC)? Use the Get-Command cmdlet and specify a noun of *dsc*: Get-Command -Noun *DSC*
PowerTip: Find Amount of Time Between Two Dates
Summary: Learn how to use Windows PowerShell to find the amount of time between two dates. How can I use Windows PowerShell to determin how many days until Windows PowerShell Saturday on March 19, 2016 in Tampa? There are many ways to find the difference between two dates. I use the [datetime] type accelerator and subtraction, for example: [datetime]'3/19/16' - [datetime]::now
Weekend Scripter: Find Information on the Hey, Scripting Guy! Blog
Summary: Ed Wilson, Microsoft Scripting Guy, talks about how to find stuff on the Hey, Scripting Guy! Blog. Microsoft Scripting Guy, Ed Wilson, is here. It is hard to imagine that it is 2016. It’s even harder to imagine that I have been writing the Hey, Scripting Guy! Blog since 2008! With the current pace of twice a day posts, 7 days a week, there are literally thousands of Hey, Scripting Guy! Blog posts—plus there was a team writing Scripting Guy content before there was a Hey, Scripting Guy! Blog. One of my first major projects after becoming the Microsoft Scripting Guy was to work with my editor a...