PowerShell 2 fixes for scripts