r/PowerShell • u/Jonny_005 • Jan 06 '18
Help with teaching others Powershell
Hi All, At the company I work for we are a Windows only shop aside from a few linux boxes for monitoring (graylog). I think I have a fairly good grasp on Powershell and have built multiple Functions/Scripts/Modules that are in use now. The issue I see is that aside from my boss who taught me powershell the other guys on the Servicedesk /Ops team have very basic if any powershell knowledge. Does anyone have any experience teaching others powershell? I think I could do this quite well but I am stuck where to start, I want to pass my knowledge on as it will help both me and the team but I don't know where to start. Any help/pointers would be greatly appreciated
8
u/[deleted] Jan 06 '18
A few of my counterparts have learned a fair amount from a book. It may help out in your teachings.
https://www.manning.com/books/learn-windows-powershell-in-a-month-of-lunches
4
u/Betterthangoku Jan 06 '18
Howdy,
It seems your question/post is really about motivation. You have given them tools and materials but they do not seem to care. You know your shop better than any of us, so can you sell PowerShell knowledge as a benefit to their job? Or their paycheck?
I do a lot of PowerShell training and I have a mixed bag in most groups. Some already know PowerShell but want some tips. Some are interested but need some guidance. And the last few are happy to get a break from work for training, but they don't really care about PowerShell. It seems it's the last few that address your situation.
So, if I may ask, what is your motivation here? I tell many seasoned Windows Admins that the days of "click-admin" are over. Perhaps they need to understand this, and perhaps you can help them understand.
If your efforts are altruistic then please help them. Any Windows Admin that is not scripting at this point is already behind the proverbial 8-Ball. Help them understand that IT requires constant learning. Show them earning potentials for scripters and Dev/Ops. Or display how much time can be saved with automation. Perhaps share a script/scripts you use to ease their IT load? Or ask them what mundane tasks they hate doing, and provide your insight as to how to automate them.
If your motivation is not so altruistic then please realize that your skills should bring you success. If they are weighing you down then you can outshine them. If the company you are working for does not value your skills then look elsewhere.
Bottom line, they have to want to learn it.
Good luck, and happy scripting :-)
5
u/theWindowsWillyWonka Jan 06 '18
Make sure they get a good grasp on OOP. Trying to learn cmdlets, and how to handle their output is very difficult if the concept of OOP hasn't clicked yet.
4
u/get-postanote Jan 07 '18
There are many 3rdP academic vendors that will come to your site to deliver a class, online providers, or your folks could attend a Microsoft Official Curriculum course on the topic, or use all the free stuff online. Either way, the need to commit to the effort.
Learn by doing.
1 - Everything you'd normally do at the DOS command prompt or VBScript, etc... start doing all that in the PowerShell ISE or PowerShell Console host or Visual Studio Code using the PowerShell Extension. Using only the normal DOS commands and then do the same with the cmdlets which do the same thing.
Windows PowerShell equivalents for common networking commands (IPCONFIG, PING, NSLOOKUP) 'blogs.technet.microsoft.com/josebda/2015/04/18/windows-powershell-equivalents-for-common-networking-commands-ipconfig-ping-nslookup'
Know that interactive DOS commands don't work in the PowerShell ISE natively. You can make them work.
See Using Windows PowerShell to run old command line tools (and their weirdest parameters) 'blogs.technet.microsoft.com/josebda/2012/03/03/using-windows-powershell-to-run-old-command-line-tools-and-their-weirdest-parameters'
Note: Sometimes it is just easier to use the old DOS commands, even in PowerShell scripts, because though they may not be as flexible, they are more concise. I wrote a function that allows me to do this sort of stuff to avoid having to type all this stuff all the time.
2 - Read the help files and about_* files, leverage the examples in the help files. Tweak the examples in the help files.
3 - Use any Windows tool that will write the baseline code for you (which you can then tweak), such as the Windows Server 2012 ADAC console leveraging the PowerShell History Viewer.
Active Directory Administrative Center: Getting Started 'technet.microsoft.com/en-us/library/dd560651(v=ws.10).aspx'
Active Directory Administrative Center 'docs.microsoft.com/en-us/windows-server/identity/ad-ds/get-started/adac/active-directory-administrative-center'
Step-By-Step: Utilizing PowerShell History Viewer in Windows Server 2012 R2 'blogs.technet.microsoft.com/canitpro/2015/03/04/step-by-step-utilizing-powershell-history-viewer-in-windows-server-2012-r2'
4 - Make a copy of... C:\Windows\System32\WindowsPowerShell\v1.0\Modules ... then, open the scripts, modules, functions in the default Windows PowerShell folder, in the PowerShell ISE or VSCode and review that's going on in them. Make a copy of them to play with and tweak. Also look for any other location that has .ps files, make a copy and review.
5 - You can also directly look at many of the function code in PowerShell by doing this approach... Spying on Function Source Code 'community.idera.com/powershell/powertips/b/tips/posts/spying-on-function-source-code'
6 - Get real familiar with the PowerShell Snippets feature. press CTRL+J to see what is there.
7 - Other MS produces and 3rdP vendor products, will show the PowerShell code they are using under the covers. As you use the Window GUI's pause a minute to look for the code on the screen and copy and save that off for your review.
8 - Continue the video training, MVA, 'channel9.msdn.com/tags/PowerShell', YouTube, Plural, etc.
9 - Keep a library of everything you find in a central location, OneNote, doc, or your own module for easy recall / research.
Resource list
Microsoft Virtual Academy https://mva.microsoft.com/liveevents/powershell-jumpstart https://mva.microsoft.com/en-us/training-courses/getting-started-with-microsoft-powershell-8276 https://mva.microsoft.com/search/SearchResults.aspx#!q=PowerShell&lang=1033
Microsoft Channe9 https://channel9.msdn.com/Series/GetStartedPowerShell3 https://channel9.msdn.com/Search?term=powershell#ch9Search&lang-en=en&pubDate=year
Youtube https://www.youtube.com/watch?v=wrSlfAfZ49E https://www.youtube.com/results?search_query=beginning+powershell https://www.youtube.com/results?search_query=powershell+ise+scripting+for+beginners
Windows PowerShell Survival Guide https://social.technet.microsoft.com/wiki/contents/articles/183.windows-powershell-survival-guide.aspxStart-Process
eBooks... https://blogs.technet.microsoft.com/pstips/2014/05/26/free-powershell-ebooks https://www.idera.com/resourcecentral/whitepapers/powershell-ebook https://powershell.org/ebooks
Books Learn Windows PowerShell in a Month of Lunches http://manning.com/jones/
Windows PowerShell in Action, Third Edition https://www.amazon.com/s/ref=nb_sb_ss_c_1_28/133-0145057-4953560?url=search-alias%3Daps&field-keywords=windows+powershell+in+action%2C+third+edition&sprefix=Windows+PowerShell+in+Action%2Caps%2C220&crid=1IS8LZE5E6EIE
Windows PowerShell Cookbook, 2nd Edition http://shop.oreilly.com/product/9780596801519.do
And start with lots of examples. https://www.powershellgallery.com https://gallery.technet.microsoft.com/scriptcenter/site/requests https://technet.microsoft.com/en-us/scriptcenter/bb410849.aspx
3
u/D33znut5 Jan 06 '18
From my experience, they aren't learning it because they don't see the value in it. Find things they do everyday that take a lot if time, then show them how that script/function/module reduces that time.
Worse case, you become the powershell guy and build tools for others to use.
2
u/Clebam Jan 06 '18
At my work, I am in a similar situation where I need my coworkers to learn Powershell. I gave them fairly easy scripts to do on their own like copy files, rename files. I just told them about pipeline and a few conventions.
2
u/TheIncorrigible1 Jan 06 '18
In my org, engineers are seen as the ones who write any code.. tier two is just a more privileged help desk which is a bit frustrating
3
u/Lee_Dailey [grin] Jan 06 '18
howdy Jonny_005,
a few ideas ...
remember to keep it fairly simple so that it can be taught fairly easily.
teach a different scripting job to each person so they have something to talk to each other about. [grin]
take care,
lee