4 ms·
Well sure, I guess my problem is that the current console is terrible, including the powershell.
by leobelle 13y ago
Well sure, I guess my problem is that the current console is terrible, including the powershell.
- marshray 13y agoConsole window aside, what do you think of Powershell as a shell/scripting language?
- ygra 13y agoI'd hazard a guess and say that they didn't use it much and only noticed »Whoa, I have to type Get-ChildItem instead of ls? That's so bloated, get me out of here.« (Side note: I'm a developer, not an administrator and I use PowerShell as such – I have no clue of how to query AD or manage IIS, but I do know the language very well. I also was a technical reviewer of the PowerShell Cookbook 2nd ed.) From my experience the language has some quirks (that are being slowly remedied in recent versions, e.g. handling of one-element arrays), but otherwise is quite well designed. The quite consistent naming of cmdlets give you enough hints to figure out what a command would be, if you only knows it exists, e.g. querying things always start with Get, projection is done with Select, etc. In a way, PowerShell is more unixy than traditional Unix utilities in that they really do one thing and only one thing. This can lead some to consider PowerShell overly verbose, because the pipeline often looks like Get-Things | Select-Things | Format-Things But to me this is actually nicer because I can concentrate on each part individually and not figure out the switch to ls that tells me the file size. And well, PowerShell passes objects through the pipeline so most of the time you can cut text processing to a minimum because you already get what you need directly (which is not to say that text processing is poor in PowerShell – -match, -replace represent grep and sed and switch -regex is very nice for quickly writing parsers for semi-structured text content).
- marshray 13y agoThanks! Sounds like I will have to get serious about finding time to get it under my fingers then.
- ygra 13y agoI started out code-golfing Project Euler problems in PowerShell and later noticed that because it's .NET-based it can complement .NET development fairly well. Examples below are all things I did recently. Need to fiddle around with a format string to get it right? '{0:yyyy-MM-dd}' -f (Get-Date) Or need to quickly test a web service whether the new method works correctly? $p = New-WebServiceProxy http://localhost/FooService.svc $p.AwesomeMethod() Or quickly figure out whether a license key matches with the lib you have lying around anyway: Add-Type -Path key.dll [Key.LicenseKey]::Check('...') For me it dramatically reduced the number of ConsoleApplication8624 projects in VS. In any case, if there are questions you can also drop me a mail.
- marshray 13y agoCool, thanks again