Importing the IIS PowerShell module in Windows Server 2008 R2

I encountered an odd error playing with PowerShell 2.0 in Windows Server 2008 R2.  I couldn’t import the IIS module (WebAdministration) in PowerShell using the normal command.

 

import-module -name WebAdministration

 

The strange part is that it works on some servers, but not on others.  Very odd.  After tinkering with the help and command for a while I found an alternate command which appears to work on all servers.

 

get-module -list webadministration | import-module

 

Just thought I’d share.

 

#James Kehr
Get-Member $OW | ?{$_.title –eq System Administrator”`  –and $_.certification –match “MCITP 2008, MCSE 2000, MCDST, Network+, A+”}

New-Variable –name company –value ‘ORCS Web, Inc.–description www.orcsweb.com | 1.888.313.9421’
blog comments powered by Disqus