This post is in continuation of my previous post where things got interesting while trying to execute a PS1 from a VBScript which will start/stop the website. At the end of post there was this interesting case where we tried to stop a website which did not exist ...But we would always get a Return code of 0 ...or Success message. Now that is bad for a Production Script as it should fail if we didn't give the correct website name. So for this post my sample VBScript will remain almost same with only one modification.....on the website name (in Bold Red below): Set objShell = CreateObject ( "WScript.Shell" ) strCommand = "powershell.exe -noprofile -file C:\temp\test2.ps1 -websitename WebSiteDoesnotExist -action stop -verbose" strError = objshell.run(strCommand, 1 , True ) If strError then WScript.Echo "Failed with Exit Code" & strError & "." else WScript.echo "S...
Infra + Dev's ramblings