powershell - Azure 函数 - PowerShell,安装 az cmdlet :: 术语“az”未被识别为 cmdlet 的名称
问题描述
我正在尝试az
为我的 Azure Function 将 cmdlet 安装到 Kudu 上。我目前正在关注本指南:
...但是 - 我的 Azure 函数中仍然出现以下错误:
az : The term 'az' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at run.ps1: line 1
到目前为止我已经完成的步骤:
- 在下面创建了一个
module
文件夹D:\home\site\wwwroot\Communication_with_Azure_Container_Registry\>
在
module
文件夹中,我添加了 , 的内容azure-cli/2.0.35/...
(看起来像这样):... Azure Function 代码非常简单地证明了安装 cmdlet 的能力:
if (-not (Get-Module -Name "az")) { Write-Output "azure-cli not installed"; } else { Write-Output "azure-cli installed"; } $test = 'az --help' Invoke-Expression $test Write-output `n$test
问题:
- 我的配置中是否存在不允许
az
安装 cmdlet 的内容? azure-cli
有没有其他方法可以在不实现模块的情况下访问node
?
解决方案
我解决了您问题的以下部分
az :术语“az”不被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名称的拼写,或者如果包含路径,请验证路径是否正确并重试。在 run.ps1:第 1 行
如果你执行
Test-Path -Path 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin'
你可能会得到 False。这意味着您需要从https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest安装 Azure CLI
推荐阅读
- r - pca:xy.coords(x, y) 中的错误:“x”和“y”长度不同
- c++ - Pointers in c++ and runtime errors
- node.js - NodeJS child_process:npm - 找不到命令
- c - 为什么接受工作时recv()会给我errno 88?
- excel - 使用 VBA 将数据透视表设置为基于另一个字段的特定日期
- python - Pytest 模拟 perforce 运行
- c# - DateTimeOffset 不是受支持的原始类型或有效的实体类型
- javascript - 如何在 JavaScript 中使用 for 循环
- objective-c - 如何从 lldb 中更新 NSAttributedString
- php - 使用 WordPress/ACF 在循环中更改项目的最后一个实例的类