PowerShellを使用してIISサイトにバインドを追加する
PowerShellを使用してIISアプリのバインドを制御しようとしています。スクリプトを使用して、httpとhttpsの両方のバインディングを持つサイトを作成したいと思います。 これは私がこれまでに持っているものです: Param( [Parameter(Mandatory=$True,Position=1)] [string]$hostname, [Parameter(Mandatory=$True,Position=2)] [string]$installPath, [Parameter(Mandatory=$False,Position=3)] [string]$ip ) Import-Module WebAdministration $appPoolName = $hostname + 'Pool' $port = 80 $hostRecord = $hostname+'.example.com' $bindings = @{protocol="http";bindingInformation=$ip + ":"+ $port + ":" + $hostRecord} New-Item IIS:\AppPools\$appPoolName Set-ItemProperty IIS:\AppPools\$appPoolName managedRuntimeVersion v4.0 New-Item IIS:\Sites\$hostname -Bindings $bindings -PhysicalPath $installPath Set-ItemProperty IIS:\Sites\$hostname -Name applicationPool -Value …