Windows Vista Forums

The term '>' is not recognized as a cmdlet

  1. #1


    vinod Guest

    The term '>' is not recognized as a cmdlet

    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 System SpecsSystem Spec

  2. #2


    Doug Guest

    Re: The term '>' is not recognized as a cmdlet

    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 System SpecsSystem Spec

  3. #3


    vinod Guest

    Re: The term '>' is not recognized as a cmdlet

    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 System SpecsSystem Spec

The term '>' is not recognized as a cmdlet

Similar Threads
Thread Forum
get-hotfix return 'The term 'get-hotfix' is not recognized'
Hi all, I just installed PowerShell and .NET Framwork on my computer windows xp professionnal edition Service Pack 3. So when i try to run...
PowerShell
Quest AD cmdlet -what is the cmdlet to remove computer object
there is a get-qadcomputer , is there a *delete* parameters ? sorry i've not read the documentations, thought the forum may help to speed things...
PowerShell
Invoking Cmdlet Get-Location from cmdlet,cant get Currnt Directory
Hi If we do a Get-location on a powershell it displays the curent working directory. And i want the same current working Directory when i am...
PowerShell
Whether a cmdlet derives from cmdlet or pscmdlet
Is there a simple way to determine if a cmdlet derives from cmdlet or pscmdlet (without the source)? Marco -- ---------------- PowerGadgets...
PowerShell
Term Server Printing
Hi all-- I have a client running a Window 2003 Terminal Server. One of the apps running on the server requires printing to LPT2. I need to...
PowerShell
Command doesn't work in PowerShell term but works in DOS term
Hi, I am doing a command: net share testy=c:\test /remark:"test" /grant:"domain1\account1",full which works in a DOS command shell but not...
PowerShell
'Write-object' is not recognized as a cmdlet, function, operable program, or script file
When I try to run this code within PS RC2: $strComputer = "." $colItems = get-wmiobject -class "Win32_Process" -namespace "root\CIMV2" `...
PowerShell