To resolve the issue of the cmdlet not being recognized, you need to ensure that the Azure Active Directory module for Windows PowerShell is installed on your computer and that the MSOnline
module is present. You can use the Get-Module
cmdlet to check if the MSOnline
module is present. If it is not present, you can use Windows PowerShell to import the MSOnline
module.
If you are using the Az PowerShell module, you can try installing the latest version of the module via PowerShellGet or MSI. The Get-AzApplicationInsightsProactiveDetectionConfiguration
cmdlet is part of the Az.Insights module, so you may need to ensure that this module is installed and imported as well.
# To install the Az PowerShell module via PowerShellGet
Install-Module -Name Az -AllowClobber -Scope CurrentUser
# To install the Az PowerShell module with MSI
Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'
# To import the MSOnline module
Import-Module MSOnline
# To install the Az.Insights module
Install-Module -Name Az.Insights -AllowClobber -Scope CurrentUser
Import-Module -Name Az.Insights
# To use the Get-AzApplicationInsightsProactiveDetectionConfiguration cmdlet
Get-AzApplicationInsightsProactiveDetectionConfiguration -ResourceGroupName "myResourceGroup" -Name "myAppInsights"
References: