zlacker

[parent] [thread] 5 comments
1. UltraS+(OP)[view] [source] 2026-01-07 18:14:06
If you haven't tried PowerShell I strongly recommend you do. It is really well designed and the way objects are piped between commands is brilliant and very powerful. Combined with property filters you can do SQL like queries. The ConvertTo-JSON lets you export the output of any command to JSON which is amazingly useful. As an example you can dump the entire Active Directory (Assuming you have permissions) by

Get-ADObject -Filter * -Properties * | ConvertTo-JSON > ADObjects.json

And you have access to ALL of the .NET library.

replies(1): >>haolez+33
2. haolez+33[view] [source] 2026-01-07 18:25:30
>>UltraS+(OP)
Until you have to quote a string that has ampersands in it :)
replies(2): >>ZenoAr+gI >>jborea+B25
◧◩
3. ZenoAr+gI[view] [source] [discussion] 2026-01-07 21:13:22
>>haolez+33
You mean like this...

' "Here is an ampersand... &" '

To clarify, in PowerShell there is a difference between text between single quotes (e.g. '$test') and double quotes (e.g. "$test"). Single quote strings are literal strings, so whatever text is contained within them is reproduced as written. Double quote strings are expandable strings, which means that certain text inside the string is evaluated before it is returned. If you have double quotes in a literal string, you'll see double quotes within that string, and the same should be true for ampersands.

replies(1): >>haolez+be6
◧◩
4. jborea+B25[view] [source] [discussion] 2026-01-09 02:47:59
>>haolez+33
& has no special behaviour in strings, backticks and $ on the other hand do. For example "&Some String&" and '&Some String&' are all the literal value `&Some String&`. Backticks and $ are special in double quoted strings as they are the escape character and variable reference chars respectively.
◧◩◪
5. haolez+be6[view] [source] [discussion] 2026-01-09 14:20:07
>>ZenoAr+gI
That works in some cases, not others. I'm not saying that PowerShell is bad, but it certainly isn't a masterpiece of design.
replies(1): >>ZenoAr+9Ec
◧◩◪◨
6. ZenoAr+9Ec[view] [source] [discussion] 2026-01-11 19:11:49
>>haolez+be6
What do you mean it works in some cases, not others? A literal string is a literal string in all cases.

As for it being a "masterpiece of design", it has it's quirks but compared to common Unix shells (aside from Nushell) it's far better. It doesn't need to have a perfect design in order to be a step above the competition.

I hope to continue to see the growth of Nushell, I can see that becoming the best shell one day.

[go to top]