5 ms·
Powershell has been growing on me lately. It uses objects to pass data around and it's quite nice.
by travbrack 6y ago
Powershell has been growing on me lately. It uses objects to pass data around and it's quite nice.
- AnIdiotOnTheNet 6y agoUsing powershell for a month or so and then going back to doing things with text-parsing UNIX commands really highlights how much better things could be if only we moved past doing things the same way they were done in the 70s.
- chacha2 6y agoHave you checked out NuShell?
- strbean 6y agoI'm really sad I missed the boat so hard on Powershell. I grabbed it at the first public release (beta? alpha?), and the thing was absurdly slow. Trying to `ls` took around 10 seconds. I nope'd out and didn't touch it again. Now I have a coworker who uses it religiously (on linux, who would have thought!) and when I'm watching over his shoulder I'm astounded by how great it is.
- throwaway894345 6y agoHow do people use environment variables with powershell? I often want to do `FOO=bar ./program`, but this doesn't seem to be supported. I googled briefly, but there weren't many satisfactory answers.
- majkinetor 6y ago$Env:FOO='bar'; ./program
- brutt 6y agoIt's equivalent of `export FOO='bar'; ./program` , which is not same as `FOO='bar' ./program`, which, in turn, is equivalent to `OLD_FOO="$FOO"; export FOO='bar'; ./program; export FOO="$OLD_FOO";` .
- xfer 6y agothere isn't a directly supported way. you write a function to backup, run and restore the old variable to get the same behaviour. Not very ideal.
- xfer 6y agoIt may be nice for small amount of data on pipeline, but is very slow compared to unix pipes. See their own documentation how they tell you to not do that: https://docs.microsoft.com/en-us/windows-server/administration/performance-tuning/powershell/script-authoring-considerations#processing-large-files https://docs.microsoft.com/en-us/windows-server/administrati...