As the Microsoft-centric world continues to become more PowerShell-enabled, you'll quickly find your computers littered with PowerShell extensions, which is a good thing. But how can you teach yourself to use them?
Step 1: InstallationA decent amount of extensions will always be installed by default with your operating system, but other ones - such as those related to server products - will need to be installed. For example, the Windows 7 Remote Server Administration Toolkit includes the extensions that ship with Windows Server 2008 R2, so that you can have those extensions on your management workstation. For server products (Exchange, SQL Server, etc), you'll generally just install the product's normal "Admin Tools" option on your client. This step will give you any graphical consoles normally used to manage the product, as well as any PowerShell extensions.
Step 2: DiscoveryNext, you need to find the extensions. PowerShell supports two kinds of extension: Modules and PSSnapins. Snap-ins must always be installed and registered with the system, so you can find them by running this command in PowerShell:
For modules, things can be a bit trickier. The PSModulePath environment variable tells PowerShell where modules should be located; in practice, only OS-related modules tend to be installed in that path. For those, you can discover them by running this:
However, you should also run a file search for files with a .psd1 or .psm1 filename extension, as those are also modules and may exist outside the predefined PSModulePath location.
Step 3: LoadingOnce you've found an extension, you need to load it into the shell. This works a lot like loading a snapin into the MMC: You'll have to do it every time you open a new shell window (you could also put the loading command into a profile script to have it happen automatically when you open new shell windows). For PSSnapins:
For modules, you can use just the module name for any module located in the PSModulePath locations; for modules located elsewhere, provide the complete path to the module.
Step 4: DiscoveringNow, what did that extension just add in terms of commands?
That shows you how to find the newly-loaded commands in a module or PSSnapin, respectively. Keep in mind that modules and PSSnapins may also add new PSProviders, meaning they give you a new type of storage to map into PowerShell as a drive. Some extensions may even automatically map a new drive. To see, run these commands:
From there, you can start asking for help on the new cmdlets to see how to use them.