4 ms·
I find this hard to believe unless your use is limited to "dir this" and "ping that". Powershell is like a gas station men's room in the middle of nowhere. It'
by DataWorker 9y ago
I find this hard to believe unless your use is limited to "dir this" and "ping that".
Powershell is like a gas station men's room in the middle of nowhere. It's better than nothing but nothing to celebrate.
- ZenoArrow 9y agoPowerShell has a few rough edges, but once you get over those it's super easy. Even when you can't remember the exact syntax for a command, the built-in help makes it quick to look up. What tool(s) have you tried using to write PowerShell scripts?
- gruez 9y ago>I find this hard to believe unless your use is limited to "dir this" and "ping that". as opposed to bash/posix with its confusingly named utilities? want to rename something? it's mv want to tell the time? it's date why is the command to download something curl/wget? what's the difference between if [[ stuff ]] and if [ stuff ] anyways? the list goes on. and no, man pages don't help if you don't even know which command to look for. at least powershell has a somewhat consistent naming convention for its commands (verb-something) so you can at least sort of guess what the command is.
- flukus 9y ago> want to rename something? it's mv There is a rename command as well. But apart from the first time I tried to rename a file I've never had trouble remembering it. There is a good reason for it to, internally it is a move operation. > want to tell the time? it's date Is this different in powershell? Some quick googling indicates the Get-Date is the method you want and being .net based everything deals with DateTime objects. > why is the command to download something curl/wget? I find this easier to remember than Invoke-WebRequest, or is it Invoke-RestMethod? If they were so hard to remember that could be aliased to something similar, but I've never seen anyone bother. Edit - I mean I've never heard anyone going the other way and suggest doing "alias Invoke-WebRequest=\"curl\"" in bash.
- hirsin 9y agoThey're pre-aliased to curl and get. ls works too. Most of the options won't work of course.
- gruez 9y ago> why is the command to download something curl/wget? I find this easier to remember than Invoke-WebRequest, or is it Invoke-RestMethod? easier to remember: maybe, but much less discoverable than Invoke-WebRequest/Invoke-RestMethod. this seems to be the overall trend for linux shell commands. a few characters long for easy typing, but otherwise arbitrary strings that you have to remember and have 0 discoverability. GGP's comment was about how you had to search for how to do everything in powershell, so in that respect powershell is at least not worse than bash.
- Hello71 9y agowant to rename something? it's Rename-Item, unless you also want to put it somewhere else, in which case you need Move-Item (it won't figure it out for you.) want to tell the time? it's Get-Date ("time" won't work, neither will "get-time") why is the command to download something Invoke-WebRequest? what does '&"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:about' do? and if you want to complain about ridiculous syntax, why the hell is ` the escape character instead of \ like every other language?
- gruez 9y ago>want to rename something? it's Rename-Item, unless you also want to put it somewhere else, in which case you need Move-Item (it won't figure it out for you.) so... working as intended? (unless you subscribe to the belief that rename is the same operation as moving) >want to tell the time? it's Get-Date ("time" won't work, neither will "get-time") fair point, although at least it doesn't alias any existing commands (typing time will get you a confusing output of 0 user, 0 kernel, 0 real) >what does '&"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:about' do? & = run program in specified path. i agree this isn't used in any other shell language, but then again all the linux shells are fairly similar to start with. it's probably there because otherwise it won't be able to differentiate between a command that you want to execute, and a string literal. also for windows command line programs, it's fairly stander to use /arg:value for command line arguments instead of --arg value >and if you want to complain about ridiculous syntax, why the hell is ` the escape character instead of \ like every other language? probably because \ is used in windows paths, so to avoid unnecessarily quoting every path, they chose an odd line continuation character. also, about what you were responding to for the last two points: that was more a poke at how '[' isn't actually part of the syntax, but in fact an alias for test.
- xorcist 9y ago> probably because \ is used in windows paths, Or.. you could actually encourage people to use sane path separators. The rest of the world uses a normal slash which works most of the time in Windows too. CP/M lost. URLs won. It's like UTF-16. They somehow had the means to replace Windows-1252 with UTF-16, but they can't bring themselves to move to UTF-8 which everyone else and the web uses instead.
- tonyedgecombe 9y ago>I find this hard to believe You find it hard to believe that someone who uses a tool daily gets to know it?