Open
Description
When formatting powershell code as OutputStyle.eval
, rez is using &&
to chain the commands instead of ;
. This causes the code to not be runnable by PowerShell.
from rez.resolved_context import ResolvedContext
from rez.rex import OutputStyle
ctx = ResolvedContext(["platform"])
print(ctx.get_shell_code("powershell", style=OutputStyle.eval))
This PowerShell code does not work:
Set-Item -Path "Env:REZ_USED_TIMESTAMP" -Value "1668893287"&& Set-Item -Path "Env:REZ_USED_VERSION" -Value "2.112.0"
While this one does:
Set-Item -Path "Env:REZ_USED_TIMESTAMP" -Value "1668893287"; Set-Item -Path "Env:REZ_USED_VERSION" -Value "2.112.0"
Environment
- OS: Windows 19
- Rez version: 2.112.0
- Rez python version: 3.9.13
To Reproduce
Execute the python snippet on the top of the issue.
Expected behavior
The string get_shell_code
outputs should be executable in PowerShell.
Actual behavior
The string get_shell_code
outputs is not executable in PowerShell due to &&
being used to chain commands instead of ;