Skip to content

Instantly share code, notes, and snippets.

@morgansimonsen
morgansimonsen / gist:8039966
Created December 19, 2013 14:31
Opt in to Microsoft Update with PowerShell
$mu = New-Object -ComObject Microsoft.Update.ServiceManager -Strict
$mu.AddService2("7971f918-a847-4430-9279-4a52d1efe18d",7,"")
@morgansimonsen
morgansimonsen / gist:8039845
Created December 19, 2013 14:23
List all Windows Azure availability sets and their VMs
(Get-AzureService).servicename | foreach {Get-AzureVM -ServiceName $_ } | select name,AvailabilitySetName
@morgansimonsen
morgansimonsen / gist:8039470
Created December 19, 2013 13:58
Count all CPU cores for subscription across all cloud services
# CountWACores.ps1
# Morgan Simonsen, www.cloudpower.no
# Count all CPU cores for subscription across all cloud services
$colVMs = @()
[int]$TotalCores = 0
$VMs = (Get-AzureService).servicename | foreach {Get-AzureVM -ServiceName $_ }
foreach ( $VM in $VMs )