Last active
January 3, 2018 21:00
-
-
Save aw230012/1479d2bada575624f7acd508eb6e7967 to your computer and use it in GitHub Desktop.
PowerShell Deploy script for Azure Recovery Services Vault, policy, and automated Pester test
This file contains hidden or 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
$subscriptionId = '<your subscription id>' | |
$deployment = '<unique deployment name>' | |
$configurationFile = "$PSScriptRoot\\Data\\RecoveryVaultConfiguration.json" | |
$configurationData = (Get-Content $configurationFile -Raw | ConvertFrom-Json).ConfigurationItems | |
Login-AzureRmAccount | |
Select-AzureRmSubscription -SubscriptionId $subscriptionId | |
New-AzureRmResourceGroup -Name $configurationData.ResourceGroup.Name -Location $configurationData.Location.Name -Force | |
New-AzureRmResourceGroupDeployment -Name $deployment ` | |
-ResourceGroupName $configurationData.ResourceGroup.Name ` | |
-TemplateFile './azuredeploy.json' ` | |
-TemplateParameterFile './azuredeploy.parameters.json' | |
Write-Host -ForegroundColor Cyan 'Begin automated testing with Pester...' | |
Invoke-Pester -Script '.\Tests\New-RecoveryVault.Tests.ps1' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment