Re: [PSH] Methods/functions and blank spaces




"Marcel J. Ortiz Soto [MSFT]" <mosoto@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23QJtC2waGHA.4060@xxxxxxxxxxxxxxxxxxxxxxx
I agree, its unfortunate we need this, but its the kind of tradeoff we have
to make because PowerShell is both a shell and a scripting language. In
shells people are used to using space as the delimiter.

copy a.txt b.txt
move a.txt b.txt
netstat -p tcp

Thus we need to support whitespace as a parameter delimiter. Other
programming languages on the other hand, don't need to support this.

Careful there. I can't do this:

ri a.txt b.txt

I have to specify it like so:

ri a.txt, b.txt

This has bitten me a couple of times until I remember that I have to use a
comma.

We know people get really attached to their coding styles and this might
cause them some grief at first but hopefully they'll be able to live with
this. Its not a change we made lightly. Try it out. If people still
can't get used to this after some time then go ahead and open a feature
request bug asking us to change it back.

I agree with dreeschkind, I never liked whitespace between a function name
and parens. So I'm OK with this change - at least for now. :-)

--
Keith


.



Relevant Pages

  • Re: [PSH] Methods/functions and blank spaces
    ... to make because PowerShell is both a shell and a scripting language. ... Thus we need to support whitespace as a parameter delimiter. ...
    (microsoft.public.windows.server.scripting)
  • Re: [PSH] Methods/functions and blank spaces
    ... to make because PowerShell is both a shell and a scripting language. ... Thus we need to support whitespace as a parameter delimiter. ... We changed this design in Powershell to make space to be the ...
    (microsoft.public.windows.server.scripting)
  • Re: A Different Shell Philosophy
    ... in tcsh I might type something like this ... I'd prefer to make easy tasks easy and difficult tasks ... > in virtually every scripting language. ... Shell is a lot better to do ...
    (comp.unix.shell)
  • Re: *attaching* a file to /usr/bin/mail message
    ... > I'm not stuck with mail, I use it with some shell scripts....but yeah, I ... If you're doing scripting, why not use an actual scripting language, and ...
    (freebsd-questions)
  • Re: python vs awk for simple sysamin tasks
    ... and you're timing hypotheoretical tasks which you hope ... numbers from Python when compared to shell though not on that scale. ... A proper scripting language and not a hobbled-together pseudo-language ...
    (comp.lang.python)