News for hackers. Stuff that matters.
Re:Command Line Interface Guidelines by bongodongobob on Tuesday February 06, 2024 @12:49PM (#39277726)
Whatif is one of my favorite things about powershell. Don't know what I'd do without it. Has saved me many times from completely destroying things.
Re:Command Line Interface Guidelines by ojintoad on Tuesday February 06, 2024 @01:16PM (#39278137)
Agree!

I'll go further. PowerShell covers a lot of the concerns in the OP out of the box. It is extremely well thought out and is one of my favorite cli models to buy into.

Re:Command Line Interface Guidelines by bigstrat2003 on Tuesday February 06, 2024 @02:42PM (#39279472)
Powershell is just plain a great shell. Blows all the *sh variants out of the water. I'd love for it to gain traction in Linux (so that, for example I could use it as my shell on my desktop) but I don't really see that happening.
Re:Command Line Interface Guidelines by partdavid on Wednesday February 07, 2024 @12:52PM (#39291705)
What are the things that are stopping you?

I use MacOS on my personal machine and Linux for various shellboxes and I switched to Powershell years ago and haven't looked back. Occasionally I invoke bash as a language runtime for checking shell script stuff, the way I would any other language's REPL, but for a shell? Powershell is strictly better.

The one actual problem with Powershell in this area is quoting for external commands. It's solvable in scripts by replacing certain things with double-quoted equivalents but not really interactively, and it is an occasional pain (though I still think it's overall less of a problem than quoting in general in bash and its ilk).

Re:Command Line Interface Guidelines by snuxoll on Tuesday February 06, 2024 @02:26PM (#39279241)
WhatIf in Powershell also remains completely broken; not that it doesn't work, but it is not properly passed down the call stack like it's supposed to from cmdlets or functions written in PowerShell (as opposed to those loaded from .net assemblies).
Re:Command Line Interface Guidelines by jcotton42 on Tuesday February 06, 2024 @02:50PM (#39279579)
Where have you seen this? If the function does it properly (SupportsShouldProcess) then it should pass down automatically.
Re:Command Line Interface Guidelines by partdavid on Wednesday February 07, 2024 @12:54PM (#39291731)
I have seen it, I think it's because it's not easy to see whether the cmdlets or functions your calling support and support it right. It does work, but I have seen it not always work and that results in having to check or test every command. I think the GP is overstating the incovenience, though, and Powershell is still much, much better than any Unix shell in this respect (which simply has no mechanism and no standard way to discover one).
Re:Command Line Interface Guidelines by snuxoll on Wednesday February 07, 2024 @04:02PM (#39294284)
I have written just in the last month cmdlets that have SupportsShouldProcess, and it does not pass on as it should. See https://learn.microsoft.com/en-us/powershell/scripting/learn... and https://github.com/PowerShell/PowerShell-RFC/pull/221#issuec...
Re:Command Line Interface Guidelines by jcotton42 on Thursday February 15, 2024 @02:23PM (#39387228)
Oh yikes!