Ask HN: How to effectively learn PowerShell?
I believe the best way to learn powershell is by using it as your shell, everyday, for real-world tasks, particularly in your job.<p>Start small, with ls, cp and cat, and don&#x27;t force the pace. psh is a shell first and foremost- a shell with a very nice language, but a shell all the same. So get comfortable using it as a shell.<p>First thing is to create your $PROFILE. Google for an example and see if you can edit it to suit you. Then get chocolatey, PSCX (psh community extensions), posh-git and vim, and get used to doing most of your work on the command line (like you&#x27;d do with bash, on Linux). See what tasks you can automate by writing a few short scripts- very simple things at first, like copying and renaming files, setting up directory structures and so on, then progress to processing xml and setting up scheduled tasks, and sending email, setting up credentials etc. After a few months you&#x27;ll find that you can wean yourself of windows GUIs for most of your everyday tasks and probably all of your not-so-everyday ones.<p>psh being a command-line tool, it&#x27;s far easier to learn it like that, than trying to learn the language first. You can learn the basics of the syntax allright, but there&#x27;s a bazillion commandlets that you will never be able to remember, unless you use them in your everyday work, and incorporate in your scripts, and those commandlets are often integral to the use of psh. Basically, you can&#x27;t separate the language from the use of the shell, so you shouldn&#x27;t try. Learn them both at the same time.<p><pre><code>  %        %        %
</code></pre>
Here&#x27;s my personal example: I learned psh to avoid the long rdp queues in a past workplace.<p>I guess that company didn&#x27;t want to shell out for more windows server licenses and so there was a limit to the number of people who could rdp to a server at the same time- just two or three people per server. So there was always a bit of a queue and I often had to wait between a half hour and a couple of hours before I could get a slot. Or someone would go for lunch and forget to log out, and you had to kick them out and it was generally a big drag.<p>At some point I started using psh as my windows shell, and then I found out about windows remoting [1], which sounded a lot like ssh on Linux- basically, it lets you open a shell on a remote computer. Next time I had a slot on a remote machine, I enabled remoting and suddendly I could do all the work I needed on the command line, while everyone else still had to wait in line for an RDP slot [2]. Needless to say, this made my life and my job a hell of a lot easier, not to say pleasant (I might have had a few smug smiles on my face, at times).<p>I&#x27;ll note there was only one thing I couldn&#x27;t do remotely: running a proprietery installer for the company&#x27;s platform, that only had a gui and no command-line options. Everything else, including a whole bunch of SQL stuff, I could do it remotely, on psh [3].<p>All this naturally pushed me to do more psh scripting, as it was easier to run a script than key in a dozen commends on the command-line. So I left that job feeling very comfortable with powershell, and although I didn&#x27;t quite have to use it that much in any other job since, I still use it as my primary shell at home.<p>____________________<p>[1] I think it started with this article, whose title immediately caught my attention:<p><a href="http:&#x2F;&#x2F;www.howtogeek.com&#x2F;117192&#x2F;how-to-run-powershell-commands-on-remote-computers&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.howtogeek.com&#x2F;117192&#x2F;how-to-run-powershell-comman...</a><p>[2] Noone else cared to learn powershell. I did ask. They said they didn&#x27;t want to have to learn a new programming language. To be fair, I never explained my remoting setup to anyone, because they would probably tell me to stop using it (I was just a junior dev at the time). Note also that I never enabled remoting on any of our public-facing servers, just in case there was some vulnerability that could be exploited.<p>[3] I also used vim and netrw to edit my scripts on the remote server directly, over a UNC path, so I didn&#x27;t have to re-upload them every time I needed to change them. This was a very Linux-y way to do stuff and really unusual where I worked.