I have a powershell script (test.ps1) and I want to run this from a batch file. The batch file contains the following:
PowerShell –Command “& ‘.\test.ps1’” 001
pause
When I run the batch file (as administrator) on a 32 bit Windows 7 machine, the powershell script runs successfully. When I try and run it on a 64 bit Windows 7 machine I get the following error:
C:\Windows\system32>PowerShell –Command “& ‘.\test.ps1’” 001
The term ‘.\test.ps1’ is not recognised as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if the path was included, verify that the path is correct and try again.
At line:1 char:2
+ & <<<< ‘.\test.ps1’ 001
+ CategoryInfo : ObjectNotFound: (.\test.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorID : CommandNotFoundException
Any ideas?
Thanks