/
osbornray
/
PythonHacks
Обзор
Документация
Войти
/
osbornray
/
PythonHacks
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
Azure_VM_IIS_PowerShell/Windows_IIS.ps1
27 строк
813 B
RekhuGopal
Updated
24 окт 2023, 15:46
24 окт 2023, 15:46
5b77bf3
Код
Авторство
О чём код?
$cred = Get-Credential New-AzVm ` -ResourceGroupName "Test" ` -Name "myVM" ` -Location "West Europe" ` -VirtualNetworkName "testvnet" ` -SubnetName "subnet1" ` -SecurityGroupName "nsg1" ` -PublicIpAddressName "iispip" ` -OpenPorts 80 ` -Credential $cred Set-AzVMExtension ` -ResourceGroupName "Test" ` -ExtensionName "IIS" ` -VMName "myVM" ` -Location "West Europe" ` -Publisher Microsoft.Compute ` -ExtensionType CustomScriptExtension ` -TypeHandlerVersion 1.8 ` -SettingString '{"commandToExecute":"powershell Add-WindowsFeature Web-Server; powershell Add-Content -Path \"C:\\inetpub\\wwwroot\\Default.htm\" -Value $($env:computername)"}' Get-AzPublicIPAddress ` -ResourceGroupName "Test" ` -Name "iispip" | Select-Object IpAddress