We have a NuGet package being deployed which uses a deploy.ps1 file to kick off some scripts. Inside the deploy.ps1 file we can see some OctopusParameters populated, like Octopus.Machine.Hostname and Octopus.Tentacle.CurrentDeployment.PackageFilePath, but any of the parameters for the action are empty, like Octopus.Action[Deploy DSC package].Output.Package.InstallationDirectoryPath. We’re accessing them in the following way:
Attached is our deploy.ps1 and a screenshot of the package in NuGet Package Explorer. I’ve tried with single and double quotes, encoded quotes around the step name, all with no luck.
Variables that include the step name like $OctopusParameters['Octopus.Action[Deploy DSC package].Output.Package.InstallationDirectoryPath'] are called Output variables, and they are only available after the step that creates them has finised.
The variable $OctopusParameters['Octopus.Action.Package.CustomInstallationDirectory'] is a var that is scoped to a specific step only, and for that reason its not necessary for you to specify a step name.