Install IIS $PublicSettings = '{"commandToExecute":"powershell Add-WindowsFeature Web-Server"}' Set-AzVMExtension -ExtensionName "IIS" -ResourceGroupName $resourceGroup -VMName $vmName ` -Publisher "Microsoft.C
若要查看运行中的 VM,请安装 IIS Web 服务器。 在 VM 中打开 PowerShell 提示符并运行以下命令: Azure PowerShell 复制 打开Cloud Shell Invoke-AzVMRunCommand -ResourceGroupName 'myResourceGroup' -VMName 'myVM' -CommandId 'RunPowerShellScript' -ScriptString 'Install-WindowsFeature -Name Web-Serv...
Azure PowerShell 复制 打开Cloud Shell $customConfigv2 = @{ "fileUris" = (,"https://raw.githubusercontent.com/Azure-Samples/compute-automation-configurations/master/automate-iis-v2.ps1"); "commandToExecute" = "powershell -ExecutionPolicy Unrestricted -File automate-iis-v2.ps1" } 将自定义...
Verbose#Install IIS on the VMSet-AzVMExtension`-ResourceGroupName$RG1`-ExtensionNameIIS `-VMNameVM-Spoke-01`-PublisherMicrosoft.Compute `-ExtensionTypeCustomScriptExtension `-TypeHandlerVersion1.4`-SettingString'{"commandToExecute":"powershell Add-WindowsFeature Web-Server"}'`-Location$Location1#...
$vm=Set-AzureVMDSCExtension-VM$vm-ConfigurationArchive“IISInstall.ps1.zip”-ConfigurationName“IISInstall” New-AzureVM-VM$vm-Location“West US”-ServiceName“example-1-svc”-WaitForBoot New-AzureVMConfig, Add-AzureProvisioningConfig, and New-AzureVM are the existing Azure cmdlets u...
In some scenarios, you may not be able to change the command frequently, such as you put this command file in a pipeline deployment and you do not want to type $cscfgContent each time. Then the following script provides an example of how to update the values of the parameter...
Description I'm using a service principal to query and configure another application for the purpose of putting a policy in a key vault, but every powershell command returns insufficient privileges. I have configured my service principal...
Real-world examples tested on Windows 2008 R2 through to 2016. Creating sites, configuring application pools, and examples in both the old WebAdministration module and the newer IISAdministration module.
Labs on Azure can be connected to each other or connected to a Hyper-V labusing a single command. AL can be used to setup scenarios to demo aPowerShell Gallery using Inedo ProGet,PowerShell DSC Pull Server scenarios, ADFS or a lab with3 Active Directory forests trusting each other. ...
Run the following command to install theWebJEAConfigmodule: Install-Module WebJEAConfig Run the following code to add a script to the config.json file with PowerShell: #Config.Json location and other inputs will depend on your specific configuration. ...