且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将 Azure Powershell 模块添加到 Visual Code Intellisense

更新时间:2023-11-25 07:49:39

Azure PowerShell 和 Azure CLI 之间存在差异.Azure PowerShell 仅适用于 Windows PowerShell 和 PowerShell Core,而 Azure CLI 具有对 Windows、Mac 和 Linux 的跨平台支持.这也意味着如果你在 Mac 或 Linux 上拥有 PowerShell Core,你仍然可以使用 Azure PowerShell.

There is a difference between Azure PowerShell and Azure CLI. Azure PowerShell is strictly for Windows PowerShell and PowerShell Core, whereas Azure CLI has cross-platform support for Windows, Mac and Linux. This also means if you have PowerShell Core on Mac or Linux, you can still use Azure PowerShell.

您通常可以分辨出两者之间的语法差异,例如Get-AzResourceGroupaz 组列表.似乎您想要后者(Azure CLI),因为您提到:

You can usually tell the syntactic difference between the two e.g. Get-AzResourceGroup vs az group list. It seems like you want the latter(Azure CLI), since you mention:

az 函数的智能感知

此外,使用 Microsoft 提供的默认 PowerShell 扩展将足以为 Azure PowerShell CmdLets 提供智能感知.但是,对于 Azure CLI,您可以安装 Azure CLI Tools 扩展由微软提供.这将为您编写 az 命令的任何 .azcli 文件提供智能感知.

Furthermore, using the default PowerShell extension provided by Microsoft will be good enough to provide intellisense for Azure PowerShell CmdLets. However, for Azure CLI, you can install the Azure CLI Tools extension provided by Microsoft. This will provide intellisense on any .azcli files where you write your az commands.