powershell 2 backwards compatibility fix