简体   繁体   中英

Changing Phisycal path via PowerShell for iis

我想根据变量更改我的 IIS 网站物理路径,例如 $New_Directory 包含目录路径,我想更改我的物理路径,谢谢。

You could try below PowerShell script:

Import-Module WebAdministration
$iisWebsite="C:\s1"
Set-ItemProperty IIS:\Sites\MySite -name physicalPath -value $iisWebsite

if you want to take input from the user then use this:

Import-Module WebAdministration
$iisWebsite=Read-Host "Please enter your new path"
Set-ItemProperty IIS:\Sites\MySite -name physicalPath -value $iisWebsite

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM