简体   繁体   中英

Selecting specific IIS website using powershell

I currently have several websites running under IIS. For ease lets call them site1 , site2 , and site3

My powershell script accepts a parameter from the user of which number site to work with. I am attempting to turn off site3 with simply the parameter 3

I thought it would be something along the lines of

stop-website | where-object {$_.name -like "*3*"}

this line is executed, but brought to a prompt for "name"

Name属性似乎接受通配符(尽管帮助另有说明),因此您应该可以通过以下方式停止通配符:

Stop-Website -Name *3*

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