This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-AzureVMStatus | |
{ | |
$RGs = Get-AzResourceGroup | |
foreach($RG in $RGs) | |
{ | |
$VMs = Get-AzVM -ResourceGroupName $RG.ResourceGroupName | |
foreach($VM in $VMs) | |
{ | |
$VMDetail = Get-AzVM -ResourceGroupName $RG.ResourceGroupName -Name $VM.Name -Status | |
$RGN = $VMDetail.ResourceGroupName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make sure you understand that by running code it REMOVES ALL | |
# the versions of the specific module in this example of the | |
# module Az. No error handling. | |
# TAKE EXTRA CAUTION IF RUNNING ON PRODUCTION ENVIRONMENT! | |
$versions = Get-InstalledModule Az.* | Select-Object -Property Name,Version | |
$countmods = Get-InstalledModule Az.* | Measure-Object | |
Write-Host "Modules found: " $versions |
NewerOlder