You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

调用Invoke-AzOperationalInsightsQuery提示无法识别命令问题求解

Invoke-AzOperationalInsightsQuery: The term 'Invoke-AzOperationalInsightsQuery' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

问题根因

该报错是因为当前PowerShell环境未安装、未加载包含Invoke-AzOperationalInsightsQuery命令的Azure官方模块。

解决步骤
  • 第一步:以管理员身份启动PowerShell,更新基础依赖模块
    Install-Module -Name PowerShellGet -Force -AllowClobber
  • 第二步:安装目标命令所属的Az.OperationalInsights模块
    Install-Module -Name Az.OperationalInsights -Force -AllowClobber
  • 第三步:手动导入模块确认加载无异常
    Import-Module Az.OperationalInsights
  • 第四步:验证命令是否可以正常识别
    Get-Command Invoke-AzOperationalInsightsQuery
    执行后如果返回命令的基本信息,说明问题已修复,可以正常使用该命令。
常见异常处理
  • 安装模块时提示不受信任的存储库,输入A选择同意所有操作即可继续安装
  • 国内Azure云用户使用命令前,需要先运行Connect-AzAccount -Environment AzureChinaCloud完成账号认证

内容的提问来源于stack exchange,提问作者Ethan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.05 01:54:01