19 May 2023 23:56
I have a PreDeploy.ps1 script in a package deployed in a Azure App Service step.
The PreDeploy script is executing correctly, however it’s running in PowerShell 5, and I’d prefer to run in PowerShell 7 (it’s installed on the Octopus server)
How can I configure the step to use PowerShell 7?
Thanks for getting in touch!
You might be able to specify the desired Powershell version through the use of the
If that doesn’t work then you may need to split the pre-deploy script into a separate
Run an Azure Script step where you can use the Configure Features option to specify Powershell Core.
23 May 2023 22:44
What value is Octopus expecting in Octopus.Action.PowerShell.CustomPowerShellVersion?
I’ve gotten this error message for 7 and 7.2, but I suspect it’s trying to run Powershell, not PowerShell Core:
Octopus Server has 7.2 core installed:
The value must match one of the directories contained within
You may be right that it won’t switch between core and standard though.
24 May 2023 16:19
This Pre-Deploy script needs to run during the Azure App Service step, as I’m modifying config files in a way outside of what I can do with variables.
I “resolved” the issue by moving the PowerShell 7 specific bits into it’s own script, and then calling pwsh from PreDeploy.ps1.