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

Is this actually useful?

I always thought powershell was largely just for interacting with windows components, like installing an msi or talking to active directory.

What would you actually practically use this for on a linux box?



The ramp-up period is much lower with Powershell.

It is truly an interactive ("online") environment. Almost everything is typed and through introspection the shell can offer very rich auto-completion hints, without needing tedious scripts such as those used by bash/zsh.

Quick example:

get-<Tab> cycles through all get-[whatever] commands, as you'd expect. get-certificate <Tab> cycles through all parameters available for get-certificate get-certificate -ErrorAction <Tab> cycles through the list of valid values for ErrorAction (there's like 6 of them: stop, suspend, etc.)

It is also highly standardized, there's a set of "verbs" allowed so that it's much easier to find something since everything is in a certain category (https://msdn.microsoft.com/en-us/library/ms714428(v=vs.85).a...)

It has its bad/ugly bits, but the principles are quite solid. In many ways they are what I'd expect if Richie and Thompson would have designed Unix in a modern environment (i.e. not an environment where the output of your commands would be printed :) ).


You can also use things like Get-Command (with options for -Verb, -Noun, -Module filtering) or Get-Member to inspect types/methods/properties. Very helpful when learning a new area.


Scripting. While I typically use Bash on Windows to use grep to interactively test my webserver, I'm much happier using Powershell ISE (which I don't know was ported [1]) to write standard tests with multiple parts, particularly ones that require e.g. checking cookies on the response.

1. Looks like they ported a service that does the same. https://github.com/powershell/powershelleditorservices


Can you be more specific?

Powershell instead of using grep? Or as a testing framework? Or an embedded interactive REPL?

I mean, just broadly, with basically zero knowledge of powershell, what I see is a custom scripting language with a set of common 'macro' commandlets that do little tasks.

...but, I don't see how that's useful?

How do you import a package to upload a file to S3?

I can't just install https://aws.amazon.com/powershell/ right? ...because that's not ported? So...? etc. etc. for other practical tasks.

Not trolling; just genuinely curious what actual tasks are actually supported that you could actually use this for, beyond trivial stuff like 'check if file exists'?


We are currently performing final validation on our new AWSPowerShell.NetCore module and hope to publish it to the PowerShell Gallery in the next couple of days.

Blog post to the announcement: http://blogs.aws.amazon.com/net/post/TxTUNCCDVSG05F/Introduc....


Since it's only come out not all 3rd party scripts are going to available straight away.

but there are standard http post/get/put commands so you can write your own.


Yes, and there's an extension to use it from VS Code[1]. It works pretty well (autocomplete, F8 to run a script, debugging, go-to-definition, etc.). The fact that it's a language server means it can be used from other editors to (although I don't know if any other extensions exist).

[1] https://marketplace.visualstudio.com/items?itemName=ms-vscod...


I shouldn't comment before coffee - not grep, curl.




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

Search: