|
Re: Executing Power Shell Scripts from Windows Shell On May 2, 8:48 pm, "Marcel J. Ortiz [MSFT]"
<mos...@online.microsoft.com> wrote:
> > My question is, even when the path is enclosed within double quotes,
> > why does powershell not recogonize the entire path and one single
> > argument?
>
> Its because powershell doesn't get the double quotes. cmd.exe will strip
> the double quotes. Try something like this:
>
> powershell "& 'd:\foo bar\script.ps1' "
>
> cmd will strip the double quotes and powershell will run:
> & 'd:\foo bar\script.ps1'
>
> "Mugunth" <mugunth.ku...@gmail.com> wrote in message
>
> news:1178098304.162166.326700@l77g2000hsb.googlegroups.com...
>
> > 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.
Thanks,
This is what I really needed... |