Powershell error

Hi,
I’m getting this error when trying to run a post deployment script on one of our servers. The package deploys successfully on other servers, it’s just this particular one. We are running version 2.5. Has anyone seen this particualr error before?

Please see that attached log.

Thanks,
Ian

Octopus_errors.txt (13 KB)

Hi Ian,

Thanks for reaching out. Haven’t seen this one before, and funny thing is if you look for the error message, the 2nd result is this unanswered question on stack overflow.

Seems like something funny is going on with the WebAdministration module on that machine alone. Couple of things I’d try:

  1. Compare the contents of the script that is returning the error with the same script from a working Tentacle. On a default install, the script should be at “C:\Program Files\Octopus Deploy\Tentacle\Scripts\Octopus.Features.IISWebSite_BeforePostDeploy.ps1”

  2. Remote into that machine, try to run this script and see if it returns any data

Import-Module WebAdministration -ErrorAction SilentlyContinue
Get-Website

Let me know how that goes

Dalmiro

Hi Dalmiro,

Thanks for your reply. I have compared the powershell scripts and they are the same on both servers.

The import module command Import-Module WebAdministration -ErrorAction SilentlyContinue returns nothing and The Get-Website command returns all the websites that are configured on IIS.

I have also double checked that all the same modules and role services are identical on both servers but I’m still seeing the same error.

Thanks,
Ian

Hi Ian,

Could you please try running this same script from the Script Console, pointing to the tentacle that errors out? This should run the script in the exact same context as the deployment.

Import-Module WebAdministration -ErrorAction SilentlyContinue
Get-Website

Thanks,

Dalmiro