• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

The term '>' is not recognized as a cmdlet

V

vinod

#1
Hi,
I am trying samples from Bruce Payette's Book. Why I am not able to
type the sample and run? Below sample is an attempt to create script
file on Powershell prompt.


PS D:\Documents\PSH_Scripts> $x=1
PS D:\Documents\PSH_Scripts> > @'
>> function 1func { $x = 100; $script:x=10 ; "1func: x = $x"}
>> 1func
>> "my-script:x = $x"
>> '@ > my-script.ps1
>>

The term '>' is not recognized as a cmdlet, function, operable
program, or script file. Verify the term and try again.
At line:1 char:2
+ > <<<< @'

Thanks,
Vinod
 

My Computer

D
#2
Try it without typing in ">" before @'
PS D:\Documents\PSH_Scripts> @'


"vinod" <vkushwaha@gmail.com> wrote in message
news:1173968333.008065.130340@p15g2000hsd.googlegroups.com...
> Hi,
> I am trying samples from Bruce Payette's Book. Why I am not able to
> type the sample and run? Below sample is an attempt to create script
> file on Powershell prompt.
>
>
> PS D:\Documents\PSH_Scripts> $x=1
> PS D:\Documents\PSH_Scripts> > @'
>>> function 1func { $x = 100; $script:x=10 ; "1func: x = $x"}
>>> 1func
>>> "my-script:x = $x"
>>> '@ > my-script.ps1
>>>

> The term '>' is not recognized as a cmdlet, function, operable
> program, or script file. Verify the term and try again.
> At line:1 char:2
> + > <<<< @'
>
> Thanks,
> Vinod
>
 

My Computer

V

vinod

#3
On Mar 15, 12:24 pm, "Doug" <doug.sl...@gmail.com> wrote:
> Try it without typing in ">" before @'
> PS D:\Documents\PSH_Scripts> @'
>
> "vinod" <vkushw...@gmail.com> wrote in message
>
> news:1173968333.008065.130340@p15g2000hsd.googlegroups.com...
>
>
>
> > Hi,
> > I am trying samples from Bruce Payette's Book. Why I am not able to
> > type the sample and run? Below sample is an attempt to create script
> > file on Powershell prompt.

>
> > PS D:\Documents\PSH_Scripts> $x=1
> > PS D:\Documents\PSH_Scripts> > @'
> >>> function 1func { $x = 100; $script:x=10 ; "1func: x = $x"}
> >>> 1func
> >>> "my-script:x = $x"
> >>> '@ > my-script.ps1

>
> > The term '>' is not recognized as a cmdlet, function, operable
> > program, or script file. Verify the term and try again.
> > At line:1 char:2
> > + > <<<< @'

>
> > Thanks,
> > Vinod- Hide quoted text -

>
> - Show quoted text -


Today, Same script sample from Bruce's book is not giving any errors.
I don't know why.

Thanks,
Vinod
 

My Computer

Users Who Are Viewing This Thread (Users: 1, Guests: 0)