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 DSC resources with PowerShell
Summary: Learn how to find DSC resources with Windows PowerShell. How can I use Windows PowerShell to find DSC resources that are available in the PowerShell Gallery? Use the Find-DSCResource command.
Overview of the PowerShellGet module to find scripts
Summary: In this blog post, I provide a quick overview of the PowerShellGet module and its various commands. Believe it or not, the Windows PowerShell Saturday event in Tampa, Florida is coming up pretty quickly. There are still some tickets available, but they have been going pretty quickly lately. There are some awesome speakers coming to Tampa for this event and I am looking forward to seeing all of them. Something really cool is that Ashley McGlone is coming from Columbus, Ohio for the event. I was his mentor for a couple of years, and it is really great to see how successful he has become. In fact, we are g...
PowerTip: Find PowerShell modules that are installed by PowerShell Get command
Summary: Learn how to find modules that were installed by the Windows PowerShell Get command. How can I use Windows PowerShell to find modules that have been installed by the Get command? Use the Get-InstalledModule command.
PowerShell Spotlight: February 2016
Summary: Microsoft MVP, Teresa Wilson, talks about Windows PowerShell Saturday in this month’s PowerShell Spotlight. Hello scripters, I hope everyone had a marvelous weekend and is planning on an awesome week. I have been working on some of the last of the preparations for PowerShell Saturday #010 coming up in less than a month (March 19) in Tampa, FL. There are still seats available, so you have time to register. As a special favor to me, if you plan to attend, the quicker you sign up, the faster I know how many are attending and I can order the correct amount of food. Here’s a little background (in case you ...
PowerTip: Add Hyper-V network switch to network packet capture session
Summary: Learn how to add a Hyper-V virtual switch as a filter for a remote packet capture session. How can I use Windows PowerShell to add a Hyper-V Virtual switch as a provider for a remote packet capture session? Use the Add-NetEventVmSwitch cmdlet and specify the name of the switch. In the following commands, I create a new event session, specify a packet capture provider, and then add the Hyper-V switch: PS C:\>New-NetEventSession -Name "NESession01" PS C:\> Add-NetEventPacketCaptureProvider -SessionName "NESession01" PS C:\> Add-NetEventVMSwitch -Name "Network Adapter 2 - Virtual Switch"
PowerTip: Add virtual network adapter to packet capture session
Summary: Learn how to use Windows PowerShell to add a virtual network adapter to a network packet capture session. How can I use Windows PowerShell to add a virtual network adapter to a network packet capture session? Use the Add-NetEventVmNetworkAdapter cmdlet and specify the name of the adapter. In the following example, I create a net event session, add a capture provider, and then specify the virtual network adapter: PS C:\>New-NetEventSession -Name "NESession01" PS C:\> Add-NetEventPacketCaptureProvider -SessionName "NESession01" PS C:\> Add-NetEventVMNetworkAdapter -Name "LargeGuid"
PowerTip: Use PowerShell to add ETW provider to a session
Summary: Use Windows PowerShell to add an ETW provider to a session. How can I use Windows PowerShell to add an ETW provider to a session? Use the Add-NetEventProvider cmdlet and specify the name of the session and the provider. In the following example, first a net event session is created, and then the TCPIP ETW provider is added to the session: PS C:\>New-NetEventSession -SessionName "Session01" PS C:\> Add-NetEventProvider -Name "Microsoft-Windows-TCPIP" -SessionName "Session01"
PowerTip: Add network adapter to packet capture session
Summary: Learn to use Windows PowerShell to add a network adapter to a capture session. How can I use Windows PowerShell to add a network adapter to a packet capture session? Use the Add-NetEventNetworkAdapter cmdlet and specify the name of the adapter. In the following example, I create a network capture session, add a provider, and then add the network adapter: PS C:\>New-NetEventSession -Name "Session38" PS C:\> Add-NetEventPacketCaptureProvider -SessionName "Session38" PS C:\> Add-NetEventNetworkAdapter -Name "Ethernet01"
PowerTip: Set ErrorActionPreference to original value
Summary: Cloud & Datacenter Management MVP, Thomas Rayner, shows how to work with the ErrorActionPreference variable in Windows PowerShell. I have a script that requires me to change the ErrorActionPreference variable, but how can I set it to its original value after the script is done? Store the current value of $ErrorActionPreference and set it again later: $OldEAP = $ErrorActionPreference $ErrorActionPreference = 'silentlycontinue' #Your script runs in here $ErrorActionPreference = $OldEAP