Your SlideShare is downloading. ×

PowerShell crash course

677

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
677
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
28
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. 75-Minute PowerShellCrash Course
    Don Jones
    Concentrated Technology
    http://ConcentratedTech.com
  • 2. 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 @concentratdgreg
    This work is copyright ©Concentrated Technology, LLC
  • 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
  • 8. Manipulating Objects
    Sorting
    Measuring
    Selecting subsets
    Selecting specific properties (columns)
  • 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 rootCIMv2)
    Specify –filter (WQL syntax, not PowerShell)
    Pipe to Sort, Select, Where, etc.
    Drive inventory anyone?
    Use WMI Explorer to locate stuff
  • 14. Making Things Happen
    Batch Cmdlets
    Invoke-WmiMethod
    ForEach-Object ($_ again!)
  • 15. Scripting
    Security (Get/Set-ExecutionPolicy)
    .PS1 filename extension
    Parameterizing a script
    Script  Function
    Dot-sourcing functions
    Creating “script modules”
  • 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!
  • 19. 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 @concentratdgreg
    This work is copyright ©Concentrated Technology, LLC

×