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 ListRGVMsizes($Rg, $VmSize) | |
{ | |
if($Rg.Length -gt 0){ | |
$VMs = Get-AzVM -ResourceGroupName $Rg | |
foreach($vm in $VMs){ | |
if ($vm.HardwareProfile.VmSize -like "*"+$VmSize+"*"){ | |
Write-host $vm.Name ": " $vm.HardwareProfile.VmSize | |
} |
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
while(1 -eq 1) { | |
#get the IP of the domain assigned, by using the Cloudflare DNS server or replace with any other | |
$ip = Resolve-DnsName -Name <domain_name_here e.g. www.github.com> -Server 1.1.1.1 -Type A -ErrorAction SilentlyContinue -ErrorVariable procErr | |
#if there was an error then print a warning message | |
if($procErr){ | |
Write-Warning "Not resolved!" | |
} | |
#if the IP is not null, means it was resolved successfully |
OlderNewer