Do you need to make test checks on your Azure Portal subscription which Azure Resources you have deployed in a Resource Group? Then I've made this Pester script to check the location of a resource.
$resourcegroup = 'YOUR_REOURCE_GROUP'
$resourcename = 'YOUR_RESOURCE_NAME'
$resources = Get-AzResource -Name $resourcename -ResourceGroupName $resourcegroup
# Create an empty array
$testcases = @()
$resources.ForEach{$testcases += @{resource = $_}}
Describe 'Azure Resources'{
It "Gives correct region to <resource>" -TestCases $testcases {
$resource.Location | Should -Be 'westeurope'
}
}
What tool is Pester?
source: https://github.com/pester/Pester
Geen opmerkingen:
Een reactie posten