Ever since we upgraded to Octopus version 1.2.3.1515 on January 3, we’ve been unable to successfully deploy to any server with UAC enabled. The deployment fails at a point when one of our custom PowerShell scripts does an “import-module webadministration”. The service user is an admin on the server. When I log into the server as the admin user and run PowerShell as an administrator then run “import-module webadministration”, the script fails.
My question is, does the latest version fix this issue or should we roll back to a previous version.
So very old post but did anyone ever get back to you with a fix for this? I’m trying to run a Copy-Item script that whitelabels a site but getting stuff with the UAC problem …
I’m running Octopus 3.2.24 and the problem only seems to happen on Server 2008 with UAC running, Server 2012 works fine (with the same level of UAC).
The script I run is a batch file (not my choice!) which is a one liner xcopy, on the 2012 box it runs and copies six files, on the 2008 box it just looks to output the contents of the batch file to the console and do nothing (running locally gives access denied on both if not using elevated prompt)
Here is the snippet of the log with the server name and SHA’s removed.
Sorry for the delay here. This is very weird indeed. How are you calling the batch file from Octopus? If possible share a screenshot or the full snippet.
Would it be possible to make this a PS Script that uses copy-item?
It’s no problem, I had replaced the batch file with Copy-Item instead (direct in Octopus, didn’t trying with it being a .ps1 file). The full snippet of the batch file that wouldn’t work Server 2008 was:
cd $OctopusParameters['Octopus.Action[Deploy Website].Output.Package.InstallationDirectoryPath']
cd .\_client\$WhiteLabelFolder
.\Apply.bat
Glad to hear you found that workaround. I’d personally recommend you to use a Standalone Script Step, and select “Script inside a package” as the source. This way you can have the script in Source Control to track all its changes. http://docs.octopusdeploy.com/display/OD/Standalone+scripts