View Single Post
Old 05-02-2007   #1 (permalink)
Mugunth


 
 

Executing Power Shell Scripts from Windows Shell

Typing
powershell "D:\PowerShell Examples\TempScript.ps1"
on the cmd prompt, gives an error that,
The term 'D:\PowerShell' is not recognized as a cmdlet, function,
operable program, or script file. Verify the term and try again.
I understood that, it was because of the space.
So I removed the space and tried again and the script executed
successfully.

However,
typing
type "D:\PowerShell Examples\TempScript.ps1"
on the cmd prompt works fine.

My question is, even when the path is enclosed within double quotes,
why does powershell not recogonize the entire path and one single
argument?

Any help would be appreciated.

My System SpecsSystem Spec