The Windows PowerShell snap-in 'WebAdministration' is not installed on this computer

Part of my deploy.ps1 is updating IIS on a windows 2012 server. I get the following error in my octo logs

The Windows PowerShell snap-in ‘WebAdministration’ is not installed on this computer

The snap-in is installed on the box - i can login (as administrator), get-module -listavailable will show the WebAdministration in the list of modules.

Anyone else have this problem? Any idea what I can try? We cannot deploy to our 2012 servers at the moment.

Thanks.

Hi Sean,

Would it be possible to try restarting the Tentacle Windows service, or restarting the machine?

If you use the Script Console to execute PowerShell on the remote machine, and try the same Get-Module script, is the module shown? Here’s info about the script console:

Paul

Hi Paul

Thanks for the reply. I’ve done some more digging and it appears there are some differences re: powershell on 2012 and 2008 and below. Our test box is 2008, our staging is 2008R2 and we have a two other servers one R2 and one 2012 (soon to be more).

The deploy.ps1 has a line Add-PSSnapin, which works fine for 2008 and 2008R2 however 2012 does not like it. I got it to work on 2012 using import-module, but that line then fails on 2008.

Hi Sean,

Ahh, that old problem :slight_smile: Here’s what I use if it helps:

Add-PSSnapin WebAdministration -ErrorAction SilentlyContinue
Import-Module WebAdministration -ErrorAction SilentlyContinue

Paul

Thats magic, cheers mate!

Or in your profile maybe put “set-alias Add-PSSnapin Import-Module”