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
$clusterAdminGroupObjectIds = (New-AzADGroup ` | |
-DisplayName "AksClusterAdmin" ` | |
-MailNickname "AksClusterAdmin").Id | |
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
<# | |
.SYNOPSIS | |
Pull metrics from Azure SQL Elastic Pools. | |
.EXAMPLE | |
PS C:\> $metrics = Get-AzSqlElasticPoolMetric -Verbose | |
Get 'eDTU_used' and 'eDTU_limit' metrics averaged over | |
each hour for the last 7 days for every Azure SQL Elastic | |
Pool in all subscriptions. |
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
$VerbosePreference = 'Continue' | |
$timeGrain = '01:00:00' | |
# The datetime to start the assessment from | |
$startTime = ((Get-Date).AddDays(-7)) | |
$result = @() | |
Get-AzSubscription | Foreach-Object { | |
$subscriptionName = $_.Name | |
$null = $_ | Select-AzSubscription | |
Write-Verbose -Message ('Pulling performance data for all SQL Servers in subcription {0}...' -f $subscriptionName) |
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
$result = @() | |
$subscriptions = Get-AzSubscription | Foreach-Object { | |
$subscriptionName = $_.Name | |
$null = $_ | Select-AzSubscription | |
Get-AzStorageAccount | Foreach-Object { | |
$used = (Get-AzMetric -ResourceId $_.Id -MetricName 'UsedCapacity' -WarningAction SilentlyContinue).Data.Average | |
$result += @( | |
[PSCustomObject] @{ | |
SubscriptionName = $subscriptionName | |
StorageAccountName = $_.StorageAccountName |
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
<# | |
.SYNOPSIS | |
Restore a set of backed up Git tags from the backup file | |
created by Convert-GitTagForDsc.ps1 in the $ENV:Temp folder. | |
.PARAMETER BackupFile | |
The full path to the backup file created by Convert-GitTagForDsc.ps1. | |
.PARAMETER Remote | |
The name of the Git remote repository for your fork. |
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
<# | |
.SYNOPSIS | |
Convert Git tags to the format required by the DSC Resource module | |
CI Process. | |
.PARAMETER Remote | |
The name of the Git remote repository for your fork. | |
.PARAMETER Upstream | |
The name of the Git remote repository for the upstream fork. |
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
Invoke-RestMethod ` | |
-Method GET ` | |
-Uri 'http://169.254.169.254/metadata/scheduledevents?api-version=2017-11-01' ` | |
-UseBasicParsing ` | |
-Headers @{ 'Metadata' = 'true' } | |
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
az account set --subscription (az account list --query "[?name=='Visual Studio Enterprise'].{Id:id}" -o tsv) |
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
$colourName = 'grey' | |
# Only needs to be declared once | |
enum colour { | |
red = 0xFF0000 | |
green = 0x00FF00 | |
blue = 0x0000FF | |
white = 0xFFFFFF | |
} |
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
$colourName = 'green' | |
# Only needs to be declared once | |
enum colour { | |
red = 0xFF0000 | |
green = 0x00FF00 | |
blue = 0x0000FF | |
white = 0xFFFFFF | |
} |