Skip to content

Instantly share code, notes, and snippets.

@ivanbuzyka
Last active June 9, 2016 06:55
Show Gist options
  • Save ivanbuzyka/071df69e4a4818d880f1da76c8df7b21 to your computer and use it in GitHub Desktop.
Save ivanbuzyka/071df69e4a4818d880f1da76c8df7b21 to your computer and use it in GitHub Desktop.
# Creates VM Disk from existing disk image and then creates Azure VM#
Add-AzureDisk -DiskName "Traincore2-15-4" `
-OS Windows `
-MediaLocation "https://wndscstor5.blob.core.windows.net/vmvhds/3zl34ubhfb.m2ss20781603051726390086.vhd" `
-Verbose
#In case of using another subscription should be specified
Set-AzureSubscription -SubscriptionName "Nutzungsbasierte Bezahlung" -CurrentStorageAccountName "wndscstor5"
New-AzureVMConfig -Name "Traincore2-15-4" -InstanceSize Large -DiskName "Traincore2-15-4" | Add-AzureEndpoint -Name "Remote Desktop" -Protocol "tcp" -PublicPort 3389 -LocalPort 3389 | Add-AzureEndpoint -Name "WinRM" -Protocol "tcp" -PublicPort 5986 -LocalPort 5986 | New-AzureVM -ServiceName "Traincore2-15-4" -Location "West Europe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment