Added utility function to safely exec Powershell scripts.