3. Welcome! This is a demo-intensivesession I will capture a shell transcript, which will be downloadable from ConcentratedTech.com next week We will be covering key PowerShell usage patterns, using real-world tasks as our examples Learn these patterns and you can teach yourself to do anything you need to in PowerShell!
4. Loading Extensions, Learning Commands Snap-ins Get-PSSnapin –registered Add-PSSnapinname Get-Command –pssnapinname Modules Get-Module –listAvailable Import-Module name Get-Command –module name Help
5. Cmdlet and Parameter Names Verb-Noun (singular) -parameter value “quotes” or ‘quotes’ around strings (especially those with spaces) Use wildcards with Help Use –full, -example, and –online with Help Use Get-Command
6. Piping Like Dir | More only better Pipeline binding ByValue Pipeline binding ByPropertyName
7. Tables of Information Use Get-Member to see all “columns” Okay, these are really objects Column = Property Row = Object (instance) Use Format-List, Format-Wide, and Format-Table Wildcards work with –property param
9. Custom Property Syntax Works with –property parameter of Select-Object, Format-List, and Format-Table @{n=’col_name’;e={$_.expression}} Use this to bind ComputerNameByPropertyname
10. Two More Ways of GettingComputer Names (parentheses) with Select-Object –expand (parentheses) with Get-Content
11. Comparison Operators -eq, -ne -ge, -gt -le, -lt -list (use * as wildcard) All case-sensitive Use –ceq, -cne, etc. for case-sensitive
12. Filtering Objects Use Where-Object –filterscript {} $_ represents the current row (object) that was piped in
13. WMI Use Get-WmiObject Specify –class and –namespace (unless it’s rootIMv2) Specify –filter (WQL syntax, not PowerShell) Pipe to Sort, Select, Where, etc. Drive inventory anyone? Use WMI Explorer to locate stuff
16. That was a lot. There’s a ton more… Learn it all in an hour a day with Learn Windows PowerShell in a Month of Lunches Companion DVD includes 99 demo videos that align with each chapter
17. Final Q&A Text DONJ to 50500 for contact info See me for add’l resources Books Workshop recordings Demo videos Etc Slide decks posted to ConcentratedTech.com by next week
18. Your Feedback is Important Please fill out a session evaluation form drop it off at the conference registration desk. Thank you!