PowerTip: Programmatically Open Script in PowerShell ISE

Summary: Use Windows PowerShell to open a script in the Windows PowerShell ISE.  How can I use Windows PowerShell to run a script that will open another script in a new tab            in the Windows PowerShell ISE?  Use the CurrentPowerShellTab Files Add method from the $psISE object, for example: $psISE.CurrentPowerShellTab.Files.Add("C:\fso\Get-Battery.ps1")


Use PowerShell to Find Hotfixes Installed in Time Range

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to find hotfixes that were installed during a certain time range.  Hey, Scripting Guy! I have a problem at work. It seems there was a hotfix that was installed in the last couple of months that is causing problems with the video driver on…


PowerTip: Require Specific Module in PowerShell Script

Summary: Learn how to require a specific module in a Windows PowerShell script.  How can I prevent a Windows PowerShell script from running if it requires the Active Directory module            and the module is not available?  At first line of the script, use the #Requires statement to require the Active Directory module:…


Start Virtual Machines in Order and Wait for Stabilization

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using a Windows PowerShell workflow to ensure that virtual machines start in order and stabilize. Microsoft Scripting Guy, Ed Wilson, is here. Last month, I wrote the following blog post: Use PowerShell to Start or Stop Virtual Machines in Order. The workflow worked great. The problem is…


PowerTip: Cause Out-GridView Cmdlet to Pause

Summary: Use Windows PowerShell to pause the script while the Out-GridView displays.  How can I pause the execution of my Windows PowerShell script while the Out-GridView cmdlet displays a grid view?            (I do not need to pass information from the grid to the script.)  The –Wait parameter from the Out-GridView cmdlet will pause script execution while the grid…


Weekend Scripter: Create PowerShell Graphical Help Function

Summary: Microsoft Scripting Guy, Ed Wilson, talks about creating a graphical Help function in Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Well, I should have known. In yesterday’s post, A Graphical Tool to Explore PowerShell Help, I said it would not take too long to convert my Windows PowerShell script (that I used…


PowerTip: Use PowerShell Out-GridView to Explore Cmdlets

Summary: Use the Windows PowerShell Out-GridView cmdlet to aid in exploring cmdlets.  How can I use Windows PowerShell to graphically explore cmdlets provided by the Hyper-V module and filter by verb?  Use the Get-Command cmdlet and specify the Hyper-V module. Select the name, verb, noun, and definition            properties and pipe the results to the Out-GridView cmdlet:…


Weekend Scripter: A Graphical Tool to Explore PowerShell Help

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to explore Help topics. Microsoft Scripting Guy, Ed Wilson, is here. With the drops of the Windows Management Framework 5.0 (also known as Windows PowerShell 5.0), now is a good time to begin exploring modules, new cmdlets, and so on. It is way cool that Windows…


PowerTip: Find PowerShell Cmdlets Supplied by Module

Summary: Find Windows PowerShell cmdlets that are supplied by a specific module.  How can I easily see all the cmdlets that ship with the Hyper-V module.?  Use the Get-Command cmdlet, and specify the Hyper-V module. (Tab expansion works for module names, which is great because who can remember if Hyper-V has a hyphen?) Get-Command -Module Hyper-V


Use PowerShell for an Easy Shutdown

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to perform an easy shutdown. Microsoft Scripting Guy, Ed Wilson, is here. One of the things I do with Windows PowerShell is to automate repetitive tasks. It may sound rather obvious, but I can assure you it is not. The reason? I become a…