I am trying to set IIS auto start for an application with the following command in a script template that uses WebAdministration.
Start-ASApplication -SiteName $parentSite -VirtualPath “/$name”
Assume that $parentSite is “Default Web Site” and $name is the name of an IIS Application under that site that has been set with Set-ASApplication to autostart “All”
When I run the script template as part of a release it will freeze forever on this command and I have to cancel the deployment. But if I paste the entire script template into the script console and replace the variables with constants of the same values it works immediately. Is there any possible difference in how scripts execute in the console from how then execute when deployed that can be a clue to why the deployment is freezing.