Octopus Powershell Variables


I am trying to use one of the Octopus variables in a Post Deployment Script section of the process.

Our custom install directory is set to

#{InstallationPath}#{Octopus.Action[Deploy Cbs.MVC.Driver].Package.NuGetPackageId}

I need to be able to access this path in a powershell script, but I cannot sem to.

I get errors like ‘Array index expression is missing or not valid.’ when I use the following:-

driverWebsitePath = $Octopus.Parameters[“Octopus.Action[Deploy Driver Website MVC].Package.NuGetPackageId”];

Please could you advise.

Many thanks.


Hi Simon,

Thanks for reaching out. Try using $OctopusParameters['Octopus.Action.Package.CustomInstallationDirectory'] instead. If that doesn’t work, please follow the below instructions and send us a verbose deployment log.

1) Add these 2 variables to your project http://docs.octopusdeploy.com/display/OD/Debug+problems+with+Octopus+variables

2) Create a new release (so the new variables take effect) and deploy it. If possible skip as many steps as you can and only leave step we are troubleshooting in order to avoid the noise in the log.

3) Send us the raw log of that deployment http://docs.octopusdeploy.com/display/OD/Get+the+raw+output+from+a+task