Create a VM using PowerShell

preview_player
Показать описание
We will be following the steps found in this Microsoft doc to create a Windows VM using PowerShell.

New-AzResourceGroup -Name myResourceGroup -Location 'EastUS'

New-AzVm `
-ResourceGroupName 'myResourceGroup' `
-Name 'myVM' `
-Location 'East US' `
-VirtualNetworkName 'myVnet' `
-SubnetName 'mySubnet' `
-SecurityGroupName 'myNetworkSecurityGroup' `
-PublicIpAddressName 'myPublicIpAddress' `
-OpenPorts 80,3389

Get-AzPublicIpAddress -ResourceGroupName 'myResourceGroup' | Select-Object -Property 'IpAddress'

mstsc /v:publicIpAddress

Install-WindowsFeature -Name Web-Server -IncludeManagementTools

Remove-AzResourceGroup -Name myResourceGroup
Рекомендации по теме
join shbcf.ru