Param basics

Welcome Forums General PowerShell Q&A Param basics

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years, 2 months ago.

  • Author
  • #5809

    Points: 0
    Rank: Member

    by BustedFlush at 2013-04-16 07:13:30

    I read Don's post on param here: ... 54301.aspx
    but I'm still very confused. I tried this; it doesn't work. Why not?


    Write-host $foo, $bar

    PS C:\users\BustedFlush> .\foobar -foo big -bar fish

    At C:\users\BustedFlush\foobar.ps1:2 char:5
    + $foo
    + ~
    Missing ')' in function parameter list.
    At C:\users\BustedFlush\foobar.ps1:4 char:1
    + )
    + ~
    Unexpected token ')' in expression or statement.
    + CategoryInfo : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : MissingEndParenthesisInFunctionParameterList

    by JeffH at 2013-04-16 07:20:11

    Is that the complete script?

    by BustedFlush at 2013-04-16 07:23:09


    by JeffH at 2013-04-16 07:29:08

    I had no error. PowerShell seems to think you don't have the closing ). You might open your file in Notepad and look for any weird control characters. Or delete the ) and add it back.

    by BustedFlush at 2013-04-16 07:36:37

    Well, that's weird. It looked exactly the same in notepad, but when I pasted it back in it worked fine.

    OK, cool. Thanks!

The topic ‘Param basics’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort