Strange Powershell related error

Why is where being used to detect powershell location? It should always point to %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe