Azure / Azure/azure-cli

`az` can't be invoked by `Start-Process` since 2.40.0

Open
#24,005 1 comment 0 reactions 1 assignee Claimed by @jiasli View on GitHub
act-platform-engineering-squad Azure CLI Team Core feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Describe the bug**
Before Azure CLI 2.40.0, `az` can be invoked by `Start-Process`:

```
> Start-Process -FilePath az -NoNewWindow -ArgumentList version -Wait
{
"azure-cli": "2.40.0",
"azure-cli-core": "2.40.0",
"azure-cli-telemetry": "1.0.8",
"extensions": {
"account": "0.2.3"
}
}
```

The entry script was migrated from `az.cmd` to `az.ps1` (https://github.com/Azure/azure-cli/pull/23514) in 2.40.0. `az` can no longer be invoked by `Start-Process`:

```
> Start-Process -FilePath az -NoNewWindow -ArgumentList version -Wait
Start-Process: This command cannot be run due to the error: %1 is not a valid Win32 application.
```

This is because `Start-Process` can't invoke a `ps1` script in a separate process.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.