Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The verbosity is a positive, so long as you understand the constraints in which it works. Cmdlets are specifically Verb-Noun, where the list of verbs is restricted to an approved list (Get, Set, Add, Remove…) and the noun naturally follows what you might expect.

Want to get an organisational unit from Active Directory? Turns out the command is Get-AdOrganizationalUnit. Discoverability is built in. All of the switches are the same. Is it -R or -r for recurse on the Unix command to list OUs from LDAP? What is the command name, anyway? I dunno, but I know the flag I need is -Recurse on Powershell.

Want to dump your DNS zones? Get-DnsServerZone is too verbose, obviously, so “cd /var/named/data && grep '\\(. *A *[0-9][0-9]*\\)\\|\\(..*CNAME..*\\)' db.*” is a much better option (‘scuse the escaping on that regex). Glad we could avoid the long command names.

Born of experience, maybe. Don’t know what the command might be? Get-Command dnszone* saves the day. I suppose I could ask GPT-4 for the regex for the bind dbs, otherwise. These are all things I can teach juniors in about fifteen minutes flat. You don’t need to learn three different Turing complete languages, all of which overload the same set of flags with different operations, just to run an operation against a bunch of files. Familiar, shorthand, and obtuse is not better just because it’s familiar.



Verbosity, for everyone who has actually written any bash/posh, any code tbh, verbosity is something to cherish. Because, u know, someone is going to eventually read it, and at best they will not be cursing the previous author. So this verbosity in posh is very well calculated, and again - sadly misunderstood by bash/perl hackers who very often care only about themselves and not their fellows.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: