PowerShell 2.0: One Cmdlet at a Time 8 Get-Module

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Get-Module cmdlet.

What can I do with it?

PowerShell 2.0 introduces the concept of modules; essentially they are the evolution of snapins from PowerShell 1.0. There are some great videos below by Bruce Payette and Osama Sajid from the PowerShell team both introducing and demonstrating how to use modules: (Thanks Shay)

Episode one introduces Modules and discusses comparisons with CmdLets. Episode two demonstrates how to use Modules. Episode three illustrates how to develop script and binary Modules

Example:

Retrieve all the modules on the current system which could be imported into the current session

Get-Module -ListAvailable

How could I have done this in PowerShell 1.0?

You could have used the Get-PSSnapin cmdlet to see which snapins were available to use. To see snapins available in the current session:

Get-PSSnapin

To see snapin’s available to add to the current session use the Registered paramater:

Get-PSSnapin -Registered

1000 things 1% better!