With AZCLI installed on Windows 10, try to call az.
[ 15:09:38 ] โฏ az
error: Command not found
- shell:1:0
1 | az
| ^^ command not found
In PowerShell and CMD the command works fine and other binaries are working as expected.
โฏ get-command az
CommandType Name Version Source
----------- ---- ------- ------
Application az.cmd 0.0.0.0 C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd
Nu Shell version 0.6.1.
@cdhunt - I had this surprise too. You'll notice that az points to az.cmd which is a script file (rather than an .exe). We don't yet support automatically calling the correct system to run the script, so you'll need to do it by hand.
You can do:
> cmd /c \path\to\az.cmd
For me, that's:
> cmd /c "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.CMD"
The docs say if the command isn't recognized, it will shell out. Why would a cmd or bat file be treated differently? AZCLI is a fantastic use case for Nu and az is a lot more friendly than cmd /c "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.CMD"
@cdhunt - Ultimately, it will likely be supported, but it's not there yet. We'll need to add support to detect the type of thing it is (do we need to invoke powershell? cmd? bash? etc) before we can run it - and this detection would also work crossplatform.
We used to have shelling to a default on by default, but this causes some annoying corner cases at the system level where aborting processes would also take Nu down with them. We're working on ways to avoid this, if possible.
This is related to, and possibly a dup of, https://github.com/nushell/nushell/issues/992
Closing as duplicate.
Most helpful comment
@cdhunt - Ultimately, it will likely be supported, but it's not there yet. We'll need to add support to detect the type of thing it is (do we need to invoke powershell? cmd? bash? etc) before we can run it - and this detection would also work crossplatform.
We used to have shelling to a default on by default, but this causes some annoying corner cases at the system level where aborting processes would also take Nu down with them. We're working on ways to avoid this, if possible.