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
Using the PowerShell CIM cmdlets for fun and profit
Summary: Learn how to use CIM cmdlets for better speed, security, and data return as opposed to the WMI cmdlets in Windows PowerShell. The other day, Windows PowerShell MVP, Richard Siddaway, posted Should I use CIM or WMI with Windows PowerShell? Today, I would like to continue that discussion a little bit. You should read Richard’s blog post before you read mine today. In the old days (like way back in Windows PowerShell 1.0), if you wanted to do anything on a remote computer, you were pretty much limited to using WMI—kind of like things were in the VBScript days. Sure, there were some things that you could d...
PowerTip: Use PowerShell to get only the date
Summary: Learn how to find only the date by using the Get-Date cmdlet. How can I use Windows PowerShell to easily display only the date (not the time)? Use the Get-Date cmdlet and specify a display hint of date, for example: Get-Date -DisplayHint date
PowerTip: Use Get-Command to resolve PowerShell alias
Summary: Learn how to use the Get-Command cmdlet to resolve an alias to a Windows PowerShell command. How can I find if a Windows PowerShell command is an alias? Use the Get-Command cmdlet, for example: gcm gwmi Note: gcm is an alias for Get-Command.
PowerTip: Find schema of a WMI class
Summary: Learn how use Windows PowerShell to find the schema of a WMI class. How can I use Windows PowerShell to look at the schema of a WMI class? Use the Get-CIMClass cmdlet, for example: Get-CimClass win32_bios
Should I use CIM or WMI with Windows PowerShell?
Summary: Richard Siddaway explains the differences between the CIM cmdlets and the WMI cmdlets, and details use cases. Hey, Scripting Guy! Should I use the WMI cmdlets or the newer CIM cmdlets? —NR Hello NR, Honorary Scripting Guy, Richard Siddaway, here today filling in for my good friend, The Scripting Guy. The simple answer is that you can use either Windows Management Instrumentation (WMI) or Common Information Model (CIM) cmdlets, but there are (to my mind) some significant advantages to using the newer CIM cmdlets. Before I show you why I think you should use the CIM cmdlets, let’s do a little recap....
PowerTip: Hide a PowerShell ISE add-on
Summary: Learn how to programmatically hide a Windows PowerShell ISE add-on. How can I use code to hide one of the Windows PowerShell ISE add-ons? Use the Windows PowerShell ISE object model, and set the IsVisible property of the add-on to False, for example: $psISE.PowerShellTabs.VerticalAddOnTools.Item(0).isvisible = $false
PowerTip: Display Windows PowerShell ISE add-ons
Summary: Display the Windows PowerShell ISE add-ons that are available. How can I programmatically display the Windows PowerShell ISE add-ons that are available and show their status? Use the Windows PowerShell ISE object model to display the VerticalAddonTools collection from the PowerShellTabs collection: $psISE.PowerShellTabs.VerticalAddOnTools
PowerTip: List all scripts open in Windows PowerShell ISE
Summary: List all the scripts that are open in the Windows PowerShell ISE. How can I find which scripts are open in the Windows PowerShell ISE and if they are saved? Use the ISE object model and display the Files collection from the PowerShellTabs collection: $psISE.PowerShellTabs.Files
PowerTip: Open a script in PowerShell ISE
Summary: Automatically open a script in the Windows PowerShell ISE. How can I automatically open a script in the Windows PowerShell ISE from within a script? Use the Windows PowerShell ISE automation model, and use the Add method for the Files collection on the current PowerShell tab, for example: $psISE.CurrentPowerShellTab.Files.Add("C:\fso\backup.ps1")