I've written a script for creating new websites on our web server. If I run it manually (line by line) the script works fine, but if I run it as a .ps1 file I get an error when it attempts to set the AppPool. I can run the exact same line after the script finishes and it works fine. I've tried...