back to article Microsoft emits another peep at PowerShell 7 with new toys and the return of an old friend

Preview 5 of Microsoft's PowerShell 7 dropped last night, which means that final release is lumbering ever closer. Though there is only one more preview left ahead of a Release Candidate in time for Christmas (and the final release of .NET Core 3.1), the gang has continued to load up the cross-platform command-line shell with …

  1. Hans 1
    Happy

    While PowerShell has had if to perform conditional execution, it is a bit clunky compared to other shells. To that end, && and || have been added as pipeline operators to chain functions or cmdlets together based on the success or failure of the left-hand command.

    Ahhhh, that would be handy, that ...

    PS: Wow, I wrote something nice about them...

    1. Kabukiwookie

      Welcome to the 21sr century Microsoft.

    2. bombastic bob Silver badge
      Meh

      use of '||' and '&&'

      Looks like that it took nearly 2 decades to make it do what C was doing in the 70's... and what the POSIX shell was doing in the 80's!!!

      POSIX shell syntax with operators and return codes can seem a bit complex at first. But it should work like the C language rules for '&&' and '||' and then it makes sense. For consistency, Power Shell needs to duplicate that [and not try to set the trend on its own]. If I read things correctly, it's going to do that now?

      /me points out that MS "setting the standard" has pretty much backfired in the much wider world outside of Windows. It's "/" not "\" for path names, EXCEPT WINDOWS and DOS. It's POSIX shell-like substitution for parameters and environment everywhere *EXCEPT* windows and DOS. The use of PATH and other environment variables is standard EXCEPT for Windows [which uses the registry for 'ShellExecuteEx']. And so on.

      And that whole ".Not" thing is its OWN nightmare. I don't EVEN want to begin with *THAT*.

  2. Wemb

    Ooooo

    Three standout items for me;

    * ??= which is variable assignment only if it's new and throw an error if it's not. That'll help inexperienced coders from accidentally reusing variables

    * foreach-object -parallel : Does what it says on the tin

    * Making pwsh a fully working login shell for linux - looking forward to seeing the look on the face of my solaris-fanboy boss when I tell him that.

    All good stuff - just wish our companies windows boxes were using a version of PS that's as new as the one on my Linux box - pain in the arse having to re-write PS scripts so they're compatible with the version 5 I keep finding on our Windows fleet.

    1. Hans 1

      Re: Ooooo

      The shebang ? powershell.exe on Windows, pwsh on UNIX, a pain.

    2. bombastic bob Silver badge
      Devil

      Re: Ooooo

      I think bash under Cygwin has been working pretty much the same for a VERY long time.

      I suggest using THAT, instead. If you FEEL (not think, but the F word 'FEEL') you need ".Not"tiness, there's probably a better way to do "it".

      (C language Win32 API console utility might be the best way!)

  3. man_iii

    PS silly like putty

    What wonderful "features"! So modern... Wish we could putty into it without bothering with the start menu and like.... Maybe next century? By then perhaps we will get batch scripting! Omg! Gasp!

    1. bombastic bob Silver badge
      Linux

      Re: PS silly like putty

      Let's just use PERL and be done with it.

      The Power Shell's "dot-notty"-ness has always bugged me. Other than that, it's no different than one or two windows command line interpreters that existed back in the 3.x days...

      If not for having to shoehorn ".Not" into a command line interpreter, Power Shell _might_ have been something 'ok' I guess. Not like the shell in a POSIX system of course, which is vastly superior.

      "Nice Try". Consolation prize. participation trophy. Heh.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like