3. introductions Don Jones Senior Partner and Principal Technologist, Concentrated Technologywww.ConcentratedTech.com Windows PowerShell MVP Award Recipient Blogger at WindowsITPro.com Columnist for Microsoft TechNet Magazine and Redmond Magazinewww.TechNetMagazine.com • www.RedmondMag.com Windows PowerShell instructor and enthusiast
4. Learn Windows PowerShell in a Month of Lunches Also available: Companion DVD and Web siteMoreLunches.com Get the book! You can order an autographed version when we’re done today, and it’ll be shipped right to you in about a week
5. Memes we’ll cover What is PowerShell, and Why Should You Care? PowerShell: Command-Line Interface or Scripting Language? PowerShell Patterns and Practices(Learn these and you’ll never need another class) Turning Commands into Reusable Tools
6. Our goal To expose you to many of PowerShell’s core patterns and practices With this information, you can start to “figure out” PowerShell largely on your own! This is definitely a “crash course,” so prepare your airbags for rapid deployment We will be covering a good amount of material very quickly – the goal is to give you an idea of what PowerShell does and how it does it, not to make you an expert If you’d like a somewhat slower-paced, methodical introduction… Learn Windows PowerShell in a Month of Lunches!Or consider an instructor-led class (MOC 10325A or have me on-site)
7. Before we get started… Ask Questions! Challenge Assumptions! Share Your Experiences! This is going to mostly involve demos, not slides. You can get a recorded full-day workshop on DVD from http://ConcentratedTech.com/DVDGoPack.php if you miss anything or need a reminder If you lose any of the URLs, just visit ShellHub.com – I have them all listed there This deck is downloadable at ConcentratedTech.com/download
9. The strategic outlook Microsoft produced PowerShell because of customer demand for better administrative automation capabilities. In other words, management cares about efficiency. Who knew? Learn PowerShell = Be Efficient = Keep Job Ignore PowerShell = Keep Clicking Through Dialog Boxes = Fries With That?
10. System requirements Windows 7 / Windows Server 2008 R2 (incl Core): Installed by default Windows Vista / Windows Server 2008: Has v1; Needs v2 Windows XP / Windows Server 2003: Has nothing, Needs v2 Requires .NET Framework v2 (v3.51 is better; can live side by side with v4) To get PowerShell v2: Search for “Download Management Framework Core”
11.
12. Console and ISE in 32-bit form - window says “(x86”)Shell extensions can only run in a matching architecture (e.g., 32-bit extension runs in x86 shell). Don’t mess this up. Also make sure window title bar says “Administrator,” or you aren’t administrator.
13. Is it a CLI? Or a Scripting Language? Hint: If you can run Dir | More,you can use PowerShell.
14. Really, it’s this easy Get-Mailbox | Sort Size –descending | Select –first 100 | Move-Mailbox –Server FOO Ok, that isn’t the 100% syntax… but it’s close, and it gives you an idea of what PowerShell is. Sure, you can treat it like a VBScript replacement… but isn’t this much more cool? The tricky bit is that different audiences tend to approach PowerShell in different ways. Scripters use it to write scripts. Devs use it like “C# lite.” Admins shouldn’t be distracted by those approaches if they’re not appropriate – use it like a shell.
15. Let the demos begin Enough with the slides. Let’s do this. Start thinking: What would you like to be able to do in Windows PowerShell?Ask me how – I’ll at least tell you, and if I can, I’ll show you. Right now.
16. Patterns and practices Finding commands by using Help and Get-Command Loading new commands (extending the shell) Cmdlet naming conventions Why (almost) everything is a disk drive Parameters and Interpreting the Help Core cmdlets: Sorting, Filtering, Selecting, and More Pipeline Parameter Binding (ByValue and ByPropertyName) Working with Windows Management Instrumentation Adding custom columns (properties) Ways of feeding computer names to a –computerName parameter
17. Building reusable tools While cmdlets are written in C# or Visual Basic… …you can do something awfully close in an advanced function using PowerShell’s scripting language Let’s take a fairly simple pair of commands and turn them into the ultimate re-usable tool, all from scratch. We’ll inventory OS, service back, and BIOS information from multiple computers Then we’ll do it with a command that clears the application log on one or more computers – and implements some more PowerShell patterns and best practices
18. summary Start learning PowerShell. Find a task to automate and dive right in. Focus on patterns and practices to teach yourself. We really did cover a lot of stuff, didn’t we?
19. Thank you! Thanks to all the local folks who helped make this seminar happen… …and thanks to Microsoft IT Pro Evangelist Harold Wong, who had the idea! Remember, you can get this deck at ConcentratedTech.com/download Any last questions????
20. Learn Windows PowerShell in a Month of Lunches Also available: Companion DVD and Web siteMoreLunches.com Remember! You can order an autographed version today, and it’ll be shipped right to you in about a week!
21. My contact information Q&A: http://connect.ConcentratedTech.com Twitter: @concentrateddon LinkedIn: http://linkedin.com/in/concentratedDon Or send a text message containing DONJ to 50500 – you’ll get a reply with my contact info and a vCard link Private On-Site Training Available – contact sales@concentratedtech.com.Flat-rate pricing includes travel expenses (3-5 day classes) Get this deck from ConcentratedTech.com/download Look for “Jones-2011WestCoastTour.zip”
22. Go forth and shell! (before v3 comes out and adds a bunch of stuff)