如何将 Azure Powershell 模块添加到 Visual Code Intellisense [英] How to add Azure Powershell module to Visual Code Intellisense

查看:41
本文介绍了如何将 Azure Powershell 模块添加到 Visual Code Intellisense的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何在可视化代码中为 Azure 模块添加智能感知?我最近安装了 Azure Powershell 模块,想用可视化代码写一些 powershell 脚本,但是编辑器没有给我任何 az 函数的智能感知,比如 Get-AzResourceGroup

Does anyone know how to add the intellisense for the Azure module in visual code? I installed the Azure Powershell module recently, and want to write some powershell script using visual code, but the editor doesn't give me any intellisense for the az functions, like Get-AzResourceGroup

推荐答案

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.

这篇关于如何将 Azure Powershell 模块添加到 Visual Code Intellisense的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆