KEMBAR78
PowerShell crash course | PPTX
75-Minute PowerShellCrash CourseDon JonesConcentrated Technologyhttp://ConcentratedTech.com
This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like.For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com. For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgregThis work is copyright ©Concentrated Technology, LLC
Welcome!This is a demo-intensivesessionI will capture a shell transcript, which will be downloadable from ConcentratedTech.com next weekWe will be covering key PowerShell usage patterns, using real-world tasks as our examplesLearn these patterns and you can teach yourself to do anything you need to in PowerShell!
Loading Extensions, Learning CommandsSnap-insGet-PSSnapin –registeredAdd-PSSnapinnameGet-Command –pssnapinnameModulesGet-Module –listAvailableImport-Module nameGet-Command –module nameHelp
Cmdlet and Parameter NamesVerb-Noun (singular)-parameter value“quotes” or ‘quotes’ around strings (especially those with spaces)Use wildcards with HelpUse –full, -example, and –online with HelpUse Get-Command
PipingLike Dir | More only betterPipeline binding ByValuePipeline binding ByPropertyName
Tables of InformationUse Get-Member to see all “columns”Okay, these are really objectsColumn = PropertyRow = Object (instance)Use Format-List, Format-Wide, and Format-TableWildcards work with –property param
Manipulating ObjectsSortingMeasuringSelecting subsetsSelecting specific properties (columns)
Custom Property SyntaxWorks with –property parameter of Select-Object, Format-List, and Format-Table@{n=’col_name’;e={$_.expression}}Use this to bind ComputerNameByPropertyname
Two More Ways of GettingComputer Names(parentheses) with Select-Object –expand(parentheses) with Get-Content
Comparison Operators-eq, -ne-ge, -gt-le, -lt-list (use * as wildcard)All case-sensitiveUse –ceq, -cne, etc. for case-sensitive
Filtering ObjectsUse Where-Object –filterscript {}$_ represents the current row (object) that was piped in
WMIUse Get-WmiObjectSpecify –class and –namespace (unless it’s root\CIMv2)Specify –filter (WQL syntax, not PowerShell)Pipe to Sort, Select, Where, etc.Drive inventory anyone?Use WMI Explorer to locate stuff
Making Things HappenBatch CmdletsInvoke-WmiMethodForEach-Object ($_ again!)
ScriptingSecurity (Get/Set-ExecutionPolicy).PS1 filename extensionParameterizing a scriptScript  FunctionDot-sourcing functionsCreating “script modules”
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 LunchesCompanion DVD includes 99 demo videos that align with each chapter
Final Q&AText DONJ to 50500 for contact infoSee me for add’l resourcesBooksWorkshop recordingsDemo videosEtcSlide decks posted to ConcentratedTech.com by next week
Your Feedback is ImportantPlease fill out a session evaluation form drop it off at the conference registration desk.Thank you!
This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like.For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com. For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgregThis work is copyright ©Concentrated Technology, LLC

PowerShell crash course

  • 1.
    75-Minute PowerShellCrash CourseDonJonesConcentrated Technologyhttp://ConcentratedTech.com
  • 2.
    This slide deckwas used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like.For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com. For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgregThis work is copyright ©Concentrated Technology, LLC
  • 3.
    Welcome!This is ademo-intensivesessionI will capture a shell transcript, which will be downloadable from ConcentratedTech.com next weekWe will be covering key PowerShell usage patterns, using real-world tasks as our examplesLearn these patterns and you can teach yourself to do anything you need to in PowerShell!
  • 4.
    Loading Extensions, LearningCommandsSnap-insGet-PSSnapin –registeredAdd-PSSnapinnameGet-Command –pssnapinnameModulesGet-Module –listAvailableImport-Module nameGet-Command –module nameHelp
  • 5.
    Cmdlet and ParameterNamesVerb-Noun (singular)-parameter value“quotes” or ‘quotes’ around strings (especially those with spaces)Use wildcards with HelpUse –full, -example, and –online with HelpUse Get-Command
  • 6.
    PipingLike Dir |More only betterPipeline binding ByValuePipeline binding ByPropertyName
  • 7.
    Tables of InformationUseGet-Member to see all “columns”Okay, these are really objectsColumn = PropertyRow = Object (instance)Use Format-List, Format-Wide, and Format-TableWildcards work with –property param
  • 8.
  • 9.
    Custom Property SyntaxWorkswith –property parameter of Select-Object, Format-List, and Format-Table@{n=’col_name’;e={$_.expression}}Use this to bind ComputerNameByPropertyname
  • 10.
    Two More Waysof 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-sensitiveUse –ceq, -cne, etc. for case-sensitive
  • 12.
    Filtering ObjectsUse Where-Object–filterscript {}$_ represents the current row (object) that was piped in
  • 13.
    WMIUse Get-WmiObjectSpecify –classand –namespace (unless it’s root\CIMv2)Specify –filter (WQL syntax, not PowerShell)Pipe to Sort, Select, Where, etc.Drive inventory anyone?Use WMI Explorer to locate stuff
  • 14.
    Making Things HappenBatchCmdletsInvoke-WmiMethodForEach-Object ($_ again!)
  • 15.
    ScriptingSecurity (Get/Set-ExecutionPolicy).PS1 filenameextensionParameterizing a scriptScript  FunctionDot-sourcing functionsCreating “script modules”
  • 16.
    That was alot.There’s a ton more…Learn it all in an hour a day with Learn Windows PowerShell in a Month of LunchesCompanion DVD includes 99 demo videos that align with each chapter
  • 17.
    Final Q&AText DONJto 50500 for contact infoSee me for add’l resourcesBooksWorkshop recordingsDemo videosEtcSlide decks posted to ConcentratedTech.com by next week
  • 18.
    Your Feedback isImportantPlease fill out a session evaluation form drop it off at the conference registration desk.Thank you!
  • 19.
    This slide deckwas used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own organization however you like.For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web site, www.ConcentratedTech.com. For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgregThis work is copyright ©Concentrated Technology, LLC