I have a powershell script that use Set-OctopusVariable function to set the value of a function as a multiline string.
When I do this from bash it works fine, but when I do it from PowerShell the EOL is not respected and the output in the Manual Intervention step is very difficult to read.
The code responsible in bash is
terragrunt plan -destroy -no-color -out=plan read -r -d '' output << EOM $(cat plan) EOM set_octopusvariable "plan-output" "$output"
In PS the code is slightly different, and I have tried many different ways of replacing the EOL characters
Set-OctopusVariable -Name "plan-output" -Value (terragrunt show plan -no-color)
Just so it is clear, this is PowerShell 7 running on Linux, so the EOL chars are LF, not CRLF
Below is an image of what the step output looks like after running it through PS. If run via bash script it shows up fine…