Stories
Slash Boxes
Comments

SoylentNews is people

posted by Fnord666 on Friday May 29 2020, @01:18AM   Printer-friendly
from the PS> dept.

cmd.exe is dead, long live PowerShell: Microsoft leads aged command-line interpreter out into 'maintenance mode'

Microsoft senior program manager Rich Turner took to Twitter in recent days to remind everyone that it really is time to move on from Windows' ancient command processor, cmd.exe.

"Cmd is in maintenance mode," said the Windows Terminal and Windows Subsystem for Linux pusher, "it should not be used for interactive shell work."

[...] To be fair, cmd has been a little whiffy for a while now. As the original default command line interpreter for the Windows NT (and OS/2) era, it has its roots in the old COMMAND.COM days of DOS and Windows 95, and provided a way for admins to move their ageing batch files and scripts into a brighter, DOS-free world.

[...] Microsoft has long punted an alternative to users in the form of the vastly more capable PowerShell, which appeared in Windows-only form back in 2006 before going cross-platform and open source 10 years later (briefly acquiring the suffix "Core" as it did so).

Many organisations, however, have plenty of legacy cmd scripts still running behind the scenes. The engine running those scripts is now in "maintenance mode", meaning that something pretty major would have to go wrong before anyone in Redmond goes tinkering. Every time a change is made, explained Turner, "something critical breaks".

[...] Turner's pointer to PowerShell is not without its own problems. While PowerShell 7 may be the future, what is currently lurking in the big box of Windows is version 5.1, which, like cmd, is in maintenance mode and has received only the odd fix or three as it waited for the Core incarnation to get closer to parity.

Lee, a 20-year Microsoft veteran and principal software engineer manager, chimed in that the gang "can't update inbox to PS7 until we reconcile the LTS support gap between .NET and Windows".

Spaghetti code and structured code can be written in [nearly any] language. I've now constructed well over 3,000 .BAT/.CMD files — some dating back to the early 1990s — which I still use to this day. I'll grant there are some quick-and-dirty one-offs in the mix, but the vast majority employ structured programming, have a modification history, are fully-commented, and have help (with examples) available from the command line.

I'm looking to port them to run on Linux (Ubuntu/Mate). Many of them make use of Windows ports of Unix utilities like gawk, sed, wc, date, ls and a smattering of others as the need arose.

Context: I've been writing "batch" programs (DCL, EXEC, REXX, TECO, Tcl/Tk, Elisp, sh, csh, bash, Perl, etc.) starting in the the 1980s. It seemed that each operating system had its own command language, so I'd just learn and make use of whatever was available on that system.

Just for least-common-denominator's sake, I'm tempted to port them to bash. I have some experience with it (and other shells such as sh and csh going way back). bash also has the advantage of being written when processors were much slower and memory was severely limited. So performance should be excellent.

On the other hand, Python is popular and thereby has lots of on-line support available.

What has been your experience?


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 4, Insightful) by chromas on Friday May 29 2020, @01:37AM (2 children)

    by chromas (34) Subscriber Badge on Friday May 29 2020, @01:37AM (#1000355) Journal

    My non-expert experience with PowerShell is it's ridiculously slow to initialize. A new PS window takes at least 5 seconds to show a prompt and running a script like chocolatey also takes a couple seconds before anything happens.

    As far as I know, most major distros have Python installed by default so you should be fine if you decide to go with it. Fair warning though: if you start learning Python then you just might have to take over Bender duties in IRC :D

    Starting Score:    1  point
    Moderation   +2  
       Insightful=1, Interesting=1, Total=2
    Extra 'Insightful' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   4  
  • (Score: 0) by Anonymous Coward on Friday May 29 2020, @05:05AM

    by Anonymous Coward on Friday May 29 2020, @05:05AM (#1000417)

    not been my experience back to poshv3 on Win 7.

  • (Score: 0) by Anonymous Coward on Friday May 29 2020, @11:26AM

    by Anonymous Coward on Friday May 29 2020, @11:26AM (#1000484)

    This has not been my experience with PS either. It has been very responsive, and compared to using Python scripts, it is even more responsive. I love Python, and have for many years, for automating and gluing things together, but since I finally decided to learn PS more deeply, I'm converting my Python scripts to PS. If you're not in a Windows environment, then PS is probably not gonna be your thing. But I'm primarily Windows (Desktops and Servers) so it's perfect. I have used PS Core on an Ubuntu system, but it's not ready for prime time yet.

    Microsoft is requiring PS modules for all their applications/systems moving forward, and many vendors are now making PS modules for their software as well. It's made managing Active Directory, SQL Server instances, and even my network switches (via SSH) a lot easier and more automated. Not to mention it's actually not too bad at using APIs for things like managing Google GSuite. Powershell.org is also a friendly place to find answers to all your PS questions.