iis - Start-WebAppPool for Powershell 2.0 -
i'm experiencing problem: need command use on 2 different shells gives me chance restart web pool appliction, 1 of these shells 4.0 (and has command start-webapppool) , other 1 has ps 4.0... i'm supposed do? in advance help.
i found solution works surely powershell 2.0 , above. called inside of script that:
$args = @() $args += "stop" $args += "apppool" $args += "/apppool.name:poolnamehere" $cmd = "c:\windows\system32\inetsrv\appcmd.exe"
invoke-expression "$cmd $args" #poolnamehere stopped.
dually, restarting:
$args = @() $args += "start" $args += "apppool" $args += "/apppool.name:poolnamehere" $cmd = "c:\windows\system32\inetsrv\appcmd.exe" invoke-expression "$cmd $args" #poolnamehere started.
hope helps somebody!
Comments
Post a Comment