1 / 30

Windows PowerShell Crash Course

WSV321_R. Windows PowerShell Crash Course. Don Jones • Concentrated Technology Jeffrey Snover • Microsoft. Welcome!. We’re here to get you up and running with PowerShell – as quickly as possible.

glenys
Télécharger la présentation

Windows PowerShell Crash Course

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. WSV321_R Windows PowerShellCrash Course Don Jones • Concentrated Technology Jeffrey Snover • Microsoft

  2. Welcome! • We’re here to get you up and running with PowerShell – as quickly as possible. • 99% of what you’ll see applies to v2 and v3; we’ll point out some specific v3 coolness as we go • Please ask questions as we go, although we are on a tight schedule, so some stuff we may need to pick up at the end.

  3. Quick Introductions • Don Jones • PowerShell MVP Award Recipient • PowerShell columnist for TechNet Magazine • Author, Learn Windows PowerShell in a Month of Lunches and PowerShell in Depth (forthcoming) • Jeffrey Snover • Distinguished Engineer in the Windows Server team • Inventor of Windows PowerShell

  4. Let’s Begin! • PowerShell is a command-line interface (CLI)… • …that contains a rich, yet simplified scripting language for automating complex, multi-step tasks • Built on the .NET Framework • Extensible, so various products and technologies can be managed by “snapping in” tech-specific extensions • Most importantly… it’s discoverable! It can teach you how to use itself!

  5. Letting PowerShell Teach You How to Use PowerShell The Help System, Modules, and More

  6. The Pipeline • PowerShell has an extremely powerful pipeline that works unlike anything that’s really been done before • It carries the output of one command to the input of the next… but it does so in an amazingly flexible way • If you can master the pipeline (and the help system helps!)

  7. The PowerShell Pipeline ByValue. ByPropertyName, and ByJoveThatsAmazing

  8. Speaking of CIM… • PowerShell remains the most effective way to access Windows Management Instrumentation, which provides a wealth of management information • V2 and v3 both have the “WMI” cmdlets, which utilize the old-school DCOM/RPC protocol for communications • V3 Introduces “CIM” cmdlets, which use the same WMI back-end info repository, but communicate over WS-MAN

  9. WMI and CIM (And why WS-MAN is your new best friend)

  10. And oh, You WANT WS-MAN! • First, it’s auto-enabled in Windows Server 2012 • It’s also the basis for PowerShell’s awesome-est feature, Remoting • We’ll do a quick Remoting demo, but Don has an entire “Remoting in Depth” session that you just gotta check out.

  11. PowerShell Remotingand WS-MAN

  12. Objects • You may have heard that PowerShell is an object-oriented shell • People make a big deal of this because it enables a lot… but conceptually it’s pretty simple • Ever see an Excel spreadsheet? It’s just a data structure, right? Well, that’s all objects are. Data structures, in memory. • Every PowerShell command (well, most) produces objects… and PowerShell will even show you everything about them

  13. Object-Oriented Shell It’s all just data!

  14. But You Know… • Not every technology lends itself well to a static set of predefined commands • Take IIS, or SQL Server, or anything else that’s extensible. How do you know what commands admins will need when you don’t even know everything that might be added into the product? • The answer: Providers. PowerShell providers can make any storage – even configuration stores – look like a disk drive. You get to use familiar commands with them!

  15. PSProviders and PSDrives Adapting storage to look like a file system

  16. Lots of Smarts • PowerShell includes a full set of comparison operators that, combined with a filtering cmdlet, let you remove things from the pipeline. • It’s what’s left at the end of the pipeline that gets displayed.

  17. Comparing and Filtering Help about_comparison_operators is your friend!

  18. Hate Syntax? • Yeah, it’s harder than clicking buttons in a GUI. • And in large part you can still use a GUI if you want to, even though it may just be running PowerShell commands under the hood. • But think about where companies are headed… and think about your value to your organization.

  19. Would You Rather be a Button Monkey…or a ToolMaker? • If you do something more than once… automate it. • PowerShell finally gives us a way to do that.

  20. Become a ToolMaker Not a Button Monkey!

  21. More Fun Tips • Why “cmdlet?” • Formatting? Make it the last thing you do. • Neat tricks with double quotes. • Why you should avoid Write-Host

  22. Last Quick Tips Formatting, Quotes, and How to Really Write

  23. Contact Info for Follow-Ups • Don: • @concentrateddon on Twitter • http://bit.ly/AskDon for online Q&A • Learn Windows PowerShell in a Month of Lunches – get it anywhere or in the TechEd Bookstore! • Jeffrey: • @jsnover on Twitter • Blogs: • http://blogs.technet.com/b/windowsserver/ • http://jsnover.com/blog

  24. Related Content • WCL404: Building Reusable CLI and GUI Tools in PowerShell WSV07-TLC: Windows Server 2012 Server Manager and PowerShell DBI331: The Dirty Dozen: PowerShell Scripts for the Busy DBA SIA404: Deep Dive on Windows Server Active Directory Shell Find Me Later At “The Scripting Guys” pod in the Expo Hall!

  25. SIA, WSV, and VIR Track Resources #TE(sessioncode) Talk to our Experts at the TLC Hands-On Labs DOWNLOAD Windows Server 2012 Release Candidate microsoft.com/windowsserver DOWNLOAD Windows Azure Windowsazure.com/ teched

  26. Resources Learning TechNet • Connect. Share. Discuss. • Microsoft Certification & Training Resources http://northamerica.msteched.com www.microsoft.com/learning • Resources for IT Professionals • Resources for Developers • http://microsoft.com/technet http://microsoft.com/msdn

  27. Required Slide Complete an evaluation on CommNet and enter to win!

  28. MS Tag Scan the Tag to evaluate this session now on myTechEd Mobile

  29. © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related