Skip to content

Instantly share code, notes, and snippets.

@rdtechie
Created December 1, 2019 12:07
Show Gist options
  • Save rdtechie/a7437dd60d6b3d7a33479e47bc7da0a9 to your computer and use it in GitHub Desktop.
Save rdtechie/a7437dd60d6b3d7a33479e47bc7da0a9 to your computer and use it in GitHub Desktop.
$paramObject = @{
location = 'westeurope'
networkInterfaceName = 'insertnicnamehere'
subnetName = 'insertsubnetnamehere'
virtualNetworkId = '/subscriptions/insertsubscriptionidhere/resourceGroups/insertsubscriptionidhere/providers/Microsoft.Network/virtualNetworks/insertvnetnamehere'
virtualMachineName = 'insertvmnamehere'
virtualMachineRG = 'insertresourcegroupnamehere'
osDiskType = 'Premium_LRS'
virtualMachineSize = 'Standard_B2ms'
adminUsername = 'vmadmin'
adminPassword = ( Get-AutomationPSCredential -Name 'adminPassword' ).GetNetworkCredential().Password
domainjoinpassword = ( Get-AutomationPSCredential -Name 'domainJoinPassword' ).GetNetworkCredential().Password
diagnosticsStorageAccountName = 'vmbootdiag'
diagnosticsStorageAccountId = '/subscriptions/insertsubscriptionidhere/resourceGroups/insertresourcegroupnamehere/providers/Microsoft.Storage/storageAccounts/vmbootdiag'
zone = '1'
}
$parameters = @{
Name = 'ServerDeployment'
ResourceGroupName = 'insertresourcegroupnamehere'
TemplateFile = '.\template.json'
TemplateParameterObject = $paramObject
Verbose = $true
}
New-AzResourceGroupDeployment @parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment