Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Toshimo
Aug 23, 2012

He's outta line...

But he's right!

FlapYoJacks posted:

Or --help
Or “man ${program_name}”

Do you think PowerShell doesn't have the equivalent of man pages?

Where are you going with this bit?

Ranzear posted:

"It's word-salad enough for us to pre-alias everything and normalize the practice" is not the glowing recommendation you think it is, and then it's only aliasing the basic command and still requires whatever technovomit single-dashed-only garbage they came up with for arguments.

It would be a huge help if any of this poo poo self-documented, but can you tell me off the cuff what Get-ChildItem -h does?

Yes, it does exactly what I'd expect. And I'm 99% certain (on vacation and can't check), but if yoi just tab-complete -h it will spell out the full flag which makes it obvious.

Y'all picking a weird hill to die on, here.

Adbot
ADBOT LOVES YOU

FlapYoJacks
Feb 12, 2009
Imagine defending Powershell syntax lmfao.

EoRaptor
Sep 13, 2003

by Fluffdaddy
I don't think Powershell has chosen the best names for a lot of its commands, but I'll take it versus the previous scripting situation on Windows. I don't see MS changing course, so we are stuck with verb-noun for the foreseeable future unless you want to call dotNET directly.

Obfuscation
Jan 1, 2008
Good luck to you, I know you believe in hell
Do you guys really just type random words into cli and expect them to be valid commands? At least for me, the discoverability of any command is completely independent of it’s name - I just google for vague terms of what I’m trying to do and hope that something turns up.

Also, while linux has an great set of command line utilities, bash scripting syntax is absolute garbage.

more falafel please
Feb 26, 2005

forums poster

EoRaptor posted:

I don't think Powershell has chosen the best names for a lot of its commands, but I'll take it versus the previous scripting situation on Windows. I don't see MS changing course, so we are stuck with verb-noun for the foreseeable future unless you want to call dotNET directly.

My scripting solution for windows has been "you have python installed, right?" for over a decade

Tad Naff
Jul 8, 2004

I told you you'd be sorry buying an emoticon, but no, you were hung over. Well look at you now. It's not catching on at all!
:backtowork:

more falafel please posted:

My scripting solution for windows has been "you have python installed, right?" for over a decade

2 or 3 though?

redleader
Aug 18, 2005

Engage according to operational parameters
powershell is endless terrible decisions around one core and good idea - pass structured data instead of text around

Bongo Bill
Jan 17, 2012

Obviously the solution is to get into obscure alternative shells like Nushell.

Loezi
Dec 18, 2012

Never buy the cheap stuff

FlapYoJacks posted:

Imagine defending Powershell syntax lmfao.

I just can't understand the process that takes someone from "the super-terse *nix builtins are not very easy to lear" to whatever in the actual gently caress is going on with powershell.

...

It's cocaine, isn't it?

QuarkJets
Sep 8, 2008

I didn't think that it was controversial anywhere to point out that Powershell has some badly named commands and syntax that's somehow even worse than bash, which is an impressive feat when you consider the age of said syntaxes. Should have known that the Coding Horrors thread would teach me otherwise

Toshimo
Aug 23, 2012

He's outta line...

But he's right!
PowerShell has enough faults that it seems like some real smoothbrain poo poo to invent more of them and then to post about how not mad you are when it gets pointed out you just made some poo poo up.

QuarkJets
Sep 8, 2008

Making poo poo up, as opposed to what you're doing right now lol

QuarkJets
Sep 8, 2008

What matters is that everyone agrees that Powershell is poo poo and should go in the trash, but only after whatever the gently caress is still going on in cmd

Soricidus
Oct 21, 2010
freedom-hating statist shill

FlapYoJacks posted:

Imagine defending Powershell syntax lmfao.

Imagine defending unix cli syntax lomarf

grep -h is another fun one, although without any other arguments it just does the same as plain grep so you do get a usage summary

Toshimo
Aug 23, 2012

He's outta line...

But he's right!

QuarkJets posted:

Making poo poo up, as opposed to what you're doing right now lol

You're the one who told us you just type random commands into you Unix prompt and hope they do something non-catastrophic. Which just lmao if that's the case.

redleader
Aug 18, 2005

Engage according to operational parameters

QuarkJets posted:

What matters is that everyone agrees that Powershell is poo poo and should go in the trash, but only after whatever the gently caress is still going on in cmd

yeah, "just pass human readable strings between programs" is a clear winner in the marketplace of ideas

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen
This is how we end up with Haskell shells like turtle.

"The shell script lays on its back, its commands baking in the hot sun, beating its monads, trying to fork itself over but it can't, not without for the correct types. But you don't have the correct types."

ynohtna fucked around with this message at 11:09 on Apr 2, 2023

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
I know the core unix stuff well enough and use bash for githooks and such but I love that I can pick up any random powershell script at work and figure it out pretty easily, including when it uses first or third party powershell modules. Object piping is amazing and i've replaced some stupidly ugly, long, and fragile bash scripts with far more readable and succinct powershell scripts in the past. The way everything follows conventions is nice too; verbs are consistent and have meaning, pretty much all commands support a common set of parameters (-WhatIf, -ErrorAction, -Confirm, -Debug), .

IMO, the actual lovely things about powershell are:
1. It's Microsoft so it's rarely going to get much buy-in outside of Windows environments, and usually for good reason. The only reason I have a lot of experience with it is we use Windows and Octopus deploy at work; I don't even run Windows at home now.
2. Slow as hell. They need to figure out how to cache shell profiles in some way so they load quickly or something, idk.
3. Verb-noun instead of noun-verb. I'll take this convention over no convention at all but it's still frustrating.
4. The operators are so annoying. Let me write > instead -gt and == insteda of -eq.
5. copy on write variable scoping is a bit of a footgun but you could argue "holding it wrong" about this one I guess.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

QuarkJets posted:

syntax that's somehow even worse than bash
citation definitely needed

nielsm
Jun 1, 2009



Toshimo posted:

Do you think PowerShell doesn't have the equivalent of man pages?

Where are you going with this bit?

PowerShell doesn't have the equivalent of man pages. What it has is better than man pages. The commands exist as objects that can be be inspected and carry documentation and you can query all sorts of things about the valid syntaxes and data types. Also, creating documentation for your own commands and modules is dead easy, and makes it available in the same consistent form as that for all built-in modules.

pre:
PS C:\Windows\system32> help Set-NetAdapterLso -Parameter NoRestart

-NoRestart [<SwitchParameter>]
    Indicates that the cmdlet does not restart the network adapter after completing the operation. Many advanced
    properties require restarting the network adapter before the new settings take effect.

    Required?                    false
    Position?                    named
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false
Can your bash man do that?

Yes, it's verbose. But I'm also not a hunt-and-pecker on my keyboard, and I don't think this extra typing is going to make my key switches break.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
Whose bash mans is this

Xarn
Jun 26, 2015

more falafel please posted:

My scripting solution for windows has been "you have python installed, right?" for over a decade

Then you do where python in a script, get 0 so you try to call it and then your user gets super weird error, because some extreme brain genius in MS decided to bundle python executable that redirects to the loving MS store.


Toshimo posted:

Do you think PowerShell doesn't have the equivalent of man pages?

Where are you going with this bit?

Yes, it does exactly what I'd expect. And I'm 99% certain (on vacation and can't check), but if yoi just tab-complete -h it will spell out the full flag which makes it obvious.

Y'all picking a weird hill to die on, here.

This guy gets it:

redleader posted:

powershell is endless terrible decisions around one core and good idea - pass structured data instead of text around


Just the fact that returning empty array behaves differently from array with single element which behaves differently from array with multiple elements should tell you that PS is fundamentally broken.

Remulak
Jun 8, 2001
I can't count to four.
Yams Fan
I love the Windows Store python setup, I can send our field support python scripts without spending a ton of time helping them gently caress around with paths and installers.

CPColin
Sep 9, 2003

Big ol' smile.

Soricidus posted:

Imagine defending unix cli syntax lomarf

Imagine four computers on the edge of a cliff...

Volte
Oct 4, 2004

woosh woosh

Remulak posted:

I love the Windows Store python setup, I can send our field support python scripts without spending a ton of time helping them gently caress around with paths and installers.
They should just bundle Python directly and I have no idea why they don't.

The Bash vs Powershell fight is funny to me because they're both incomprehensible garbage as far as I'm concerned. I've had to write bash scripts on occasion for like 20+ years and I still have to consult a reference to figure out how to do basic control flow constructs.

fritz
Jul 26, 2003

CPColin posted:

Imagine four computers on the edge of a cliff...

Can I push them all off, or just the one?

CPColin
Sep 9, 2003

Big ol' smile.
Better push all of them, just in case

brap
Aug 23, 2004

Grimey Drawer

Bongo Bill posted:

Obviously the solution is to get into obscure alternative shells like Nushell.

tbh, with 24k stars, someone’s using this poo poo and is excited about it. I’m not about to write any long lived scripts in it but I’ll try it out.

QuarkJets
Sep 8, 2008

Toshimo posted:

You're the one who told us you just type random commands into you Unix prompt and hope they do something non-catastrophic. Which just lmao if that's the case.

You're literally proving my point, as that's not what I or anyone else said. "Making poo poo up" indeed lmao

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

CPColin posted:

Imagine four computers on the edge of a cliff...

The Zyborne Shell (better known as zsh)

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆

Toshimo posted:

You're the one who told us you just type random commands into you Unix prompt and hope they do something non-catastrophic. Which just lmao if that's the case.

are you aware of tab completion? there's a difference between "mash my keyboard randomly and hope something good happens" vs "type the first 3 letters of some niche rarely-used command I half-remember and then let my terminal list out the completion possibilities"

Toshimo
Aug 23, 2012

He's outta line...

But he's right!

RPATDO_LAMD posted:

are you aware of tab completion? there's a difference between "mash my keyboard randomly and hope something good happens" vs "type the first 3 letters of some niche rarely-used command I half-remember and then let my terminal list out the completion possibilities"

Of course I'm aware, but I'm not the one trying to advance the argument that unix as a monolith is full of human-readable commands by way of comparison. Find is more the exception than the rule because no newbie is ever going to sus out grep of awk or finger.

Like, Get-ChildItem does what it says on the tin and help pages in PowerShell are searchable. Acting like there's this Herculean barrier to entry is laughable. If you can figure out AIX but get stumped on PowerShell, I don't know what to tell you.

QuarkJets
Sep 8, 2008

Toshimo posted:

Of course I'm aware, but I'm not the one trying to advance the argument that unix as a monolith is full of human-readable commands by way of comparison.

Not a single post itt has said that, unix has tons of bizarre commands and I haven't seen anyone argue otherwise

FlapYoJacks
Feb 12, 2009

Toshimo posted:

Of course I'm aware, but I'm not the one trying to advance the argument that unix as a monolith is full of human-readable commands by way of comparison. Find is more the exception than the rule because no newbie is ever going to sus out grep of awk or finger.

Like, Get-ChildItem does what it says on the tin and help pages in PowerShell are searchable. Acting like there's this Herculean barrier to entry is laughable. If you can figure out AIX but get stumped on PowerShell, I don't know what to tell you.

Settle down Beavis. Maybe it’s not worth your energy getting upset about PowerShell.

Tei
Feb 19, 2011
Probation
Can't post for 4 days!

nielsm posted:

PowerShell doesn't have the equivalent of man pages. What it has is better than man pages. The commands exist as objects that can be be inspected and carry documentation and you can query all sorts of things about the valid syntaxes and data types. Also, creating documentation for your own commands and modules is dead easy, and makes it available in the same consistent form as that for all built-in modules.

pre:
PS C:\Windows\system32> help Set-NetAdapterLso -Parameter NoRestart

-NoRestart [<SwitchParameter>]
    Indicates that the cmdlet does not restart the network adapter after completing the operation. Many advanced
    properties require restarting the network adapter before the new settings take effect.

    Required?                    false
    Position?                    named
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false
Can your bash man do that?

Yes, it's verbose. But I'm also not a hunt-and-pecker on my keyboard, and I don't think this extra typing is going to make my key switches break.

this is cool, and I had no idea PS does this

what breaks the deal for me, is simply I don't know how to use it, I already I know bash, so I don't know why I would have to give the oportunity to the new thing. would the new thing make ImageMagick easier to use?

Ranzear
Jul 25, 2013

Tei posted:

this is cool, and I had no idea PS does this

Did learn this recently, but the reason I asked about (and was never directly answered) Get-ChildItem -h had more to do with how to dig into what what some particular argument does and the follow up was gonna be along the lines of 'now show me in that help page how the gently caress I show hidden files and non-hidden files?' and what a clusterfuck it turns into, because for some reason there is no composition of multiple arguments nor correct arrangement of inputs to -Attribute to do that* and is instead just -Force.

and here's the help page on -Force:

pre:
PS C:\Users\Ranzear> help dir -Parameter force

-Force

    Required?                    false
    Position?                    Named
    Accept pipeline input?       false
    Parameter set name           (All)
    Aliases                      None
    Dynamic?                     false
Like, I'm sure there's an answer, but here's where and why my statement was about self-documentation. And all of that discovery from a few months ago now was because of how fucky powershell gets with dotted directories like .git versus actually hidden stuff which may also be dotted in some cases.

But then that poster was and continues to be a shithead about it so I didn't care anymore.

*Edit: I'll take that back, "-Attribute !hidden, hidden" does work, and looking back it's obvious why "!hidden+hidden" didn't.

Ranzear fucked around with this message at 00:53 on Apr 3, 2023

Toshimo
Aug 23, 2012

He's outta line...

But he's right!

Ranzear posted:

Did learn this recently, but the reason I asked about (and was never directly answered) Get-ChildItem -h had more to do with how to dig into what what some particular argument does and the follow up was gonna be along the lines of 'now show me in that help page how the gently caress I show hidden files and non-hidden files?' and what a clusterfuck it turns into, because for some reason there is no composition of multiple arguments nor correct arrangement of inputs to -Attribute to do that* and is instead just -Force.

and here's the help page on -Force:

pre:
PS C:\Users\Ranzear> help dir -Parameter force

-Force

    Required?                    false
    Position?                    Named
    Accept pipeline input?       false
    Parameter set name           (All)
    Aliases                      None
    Dynamic?                     false
Like, I'm sure there's an answer, but here's where and why my statement was about self-documentation. And all of that discovery from a few months ago now was because of how fucky powershell gets with dotted directories like .git versus actually hidden stuff which may also be dotted in some cases.

But then that poster was and continues to be a shithead about it so I didn't care anymore.

*Edit: I'll take that back, "-Attribute !hidden, hidden" does work, and looking back it's obvious why "!hidden+hidden" didn't.

You're missing the Help files. As an admin, run "Update-Help".

And telling me you were trying to bait me so you could slam down a "Well, actually..." isn't really helping, especially since it turns out that it does what you want in the first place, you just had a bad syntax.

Now, if you've got the help and it doesn't seem that useful in this case, that's probably true because it passes the buck to the Provider and that's pretty useless on its own (but, necessarily true because Get-ChildItem is so broad and the different Provides behave completely independently).

I don't know if this was a change, because SS64, my usual go-to for PS documentation, had this to say, which is much more useful:
-force
Get all items including hidden or system files, but will not override
security/file permissions. You can also get hidden files and folders with -Hidden or
with the Hidden value of the -Attributes parameter.


I don't have a historical record, but I bet that's what the docs used to say before they switched it to "See your Provider".

As you can see from the last couple of pages, I have little patience for the bleating of "It different, it bad", so yes, I wasn't all that interested in getting baited by you.

If you want to have a good faith discussion, just ask me the things you want to ask me in the first place. I'm much more reasonable when the conversation isn't immediately and needlessly hostile.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
Please don't go full d&d brain cmon now. Nobody's having a """"bad faith discussion"""" when you're doing windows vs linux for the 9999999th time who cares.

Ranzear
Jul 25, 2013

Toshimo posted:

idk what you are crying about.
[...]
Where are you going with this bit?
[...]
Y'all picking a weird hill to die on, here.
[...]
some real smoothbrain poo poo
[...]
Acting like there's this Herculean barrier to entry

Toshimo posted:

I'm much more reasonable when the conversation isn't immediately and needlessly hostile.

I get that we're on the oldschool rough-and-tumble dead gay forum but, dude, it's just you. Maybe cool it a bit? Blowing up inane arguments into perceived personal attacks is my shtick and even I'm sick of it.

My actual problem is barely remembered from months ago with permissions in my cargo build folders and that whole tangential string of 'how the gently caress do I even' was long solved by just mass fixing/deleting garbage in explorer and not trusting powershell or linux subsystem to run git. Hell I barely trust it to symlink assets into the test builds anymore. I'm pretty sure that all related back to the whole 'Powershell can only do elevated privileges on the entire session' horror that also belongs in this thread.

Adbot
ADBOT LOVES YOU

Canine Blues Arooo
Jan 7, 2008

when you think about it...i'm the first girl you ever spent the night with



Grimey Drawer
PS is pretty sick once you pay the pretty hefty up front costs of learning and engaging with it.

The same could be said to a point with bash I guess, but the upper limit of bash ends up being limited somewhat by some architectural flaws. The fact that PS actually lets you deal with objects instead of strings is probably the killer feature tbh.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply