Open
Description
openedon Jan 12, 2021
Describe the issue or request
Playing around with the tests, I wanted to regenerate some code and tried Generate.ps1. It gave me this on macOS:
$ pwsh eng/Generate.ps1
cmd: /Users/donblas/Programming/autorest.csharp/eng/Generation.psm1:15
Line |
15 | cmd /c "$command 2>&1"
| ~~~
| The term 'cmd' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Obviously cmd doesn't exist on macOS.
Describe your ideas for solutions
The code in question:
if ($IsLinux)
{
sh -c "$command 2>&1"
}
else
{
cmd /c "$command 2>&1"
}
Hacking this to unconditionally do sh seemed to get me further.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment