Windows PowerShell Crash Course

Slides:



Advertisements
Similar presentations
Windows PowerShell Crash Course Don Jones Concentrated Technology Jeffrey Snover Microsoft WSV321.
Advertisements

© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Jeffrey Snover | Distinguished Engineer & Lead Architect Jason Helmick | Senior Technologist, Concentrated Technology.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Feature: Purchase Order Prepayments II © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: OLE Notes Migration Utility
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

How to (un)destroy your Active Directory
What’s New with IIS 8: Open Web Platform for Cloud
Microsoft Virtual Academy
5/15/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Deployment Internals: Mastering Windows Deployment Services
Running Reporting Services in SharePoint Integrated Mode: How and Why
Microsoft Virtual Academy
6/12/ :53 PM DEV311 Deep Dive into Microsoft Visual Studio Team Foundation Server 2010 Reporting Steven Borg, Principal ALM Consultant Northwest.
TechEd /3/2018 4:18 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Microsoft Ignite /17/ :56 PM
Возможности Excel 2010, о которых следует знать
Microsoft Ignite /21/2018 8:47 AM
Windows PowerShell Remoting: Definitely NOT Just for Servers
Microsoft Virtual Academy
"Oslo”: Customizing and Extending the Visual Design Experience
PowerShell Remoting in Depth
Title of Presentation 12/2/2018 3:48 PM
Manage Your Enterprise from a Single Seat: Windows PowerShell Remoting
Deep Dive into the Team Foundation Server 2012 Agile Planning Tools
12/9/2018 Desktop Virtualization Corey Hynes Kyle Rosenthal President Technical Lead HynesITe Inc Spider Consulting @windowspcguy.
The Dirty Dozen: Windows PowerShell Scripts for the Busy DBA
Microsoft Virtual Academy
DEV410: Deep Dive into Team Foundation Server 2012 Reporting
TechEd /18/2019 2:43 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
2/17/2019 7:32 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
2/24/2019 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Building SaaS Solutions on Windows Azure
Building the Perfect BI Semantic Model for Power View
Creating and Consuming OData Services for Business Applications
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows 8 Security Internals
Mikael Nystrom Senior Executive Consultant TrueSec
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
Hack-proofing your Clients using Windows 7 Security!
Tech Ed North America /27/ :04 AM Required Slide
PENSACOLA ENERGY WORK PLAN OCTOBER 10, 2016
Шитманов Дархан Қаражанұлы Тарих пәнінің
Code First Development in Microsoft ADO.NET Entity Framework 4.1
Running Reporting Services in SharePoint Integrated Mode: How and Why
Backup your private cloud workloads before it’s too late!
Title of Presentation 5/24/2019 1:26 PM
5/24/ :22 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Microsoft Virtual Academy
7/5/2019 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
TechEd /30/2019 7:18 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
What’s New in Visual Studio 2012 for Web Developers
WCL425 App Compat for Nerds Chris Jackson.
Microsoft Virtual Academy
Presentation transcript:

Windows PowerShell Crash Course 4/14/2019 9:40 PM WSV321_R Windows PowerShell Crash Course Don Jones • Concentrated Technology Jeffrey Snover • Microsoft © 2007 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.

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.

Quick Introductions Don Jones Jeffrey Snover 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

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!

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

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!)

The PowerShell Pipeline ByValue. ByPropertyName, and ByJoveThatsAmazing

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

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

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.

PowerShell Remoting and WS-MAN

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

Object-Oriented Shell It’s all just data!

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!

PSProviders and PSDrives Adapting storage to look like a file system

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.

Comparing and Filtering Help about_comparison_operators is your friend!

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.

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.

Become a ToolMaker Not a Button Monkey!

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

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

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

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!

SIA, WSV, and VIR Track Resources #TEWSV321 Talk to our Experts at the TLC Hands-On Labs DOWNLOAD Windows Server 2012 Release Candidate microsoft.com/windowsserver DOWNLOAD Microsoft System Center 2012 Evaluation microsoft.com/systemcenter

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

Submit your evals online 4/14/2019 9:40 PM Evaluations Submit your evals online http://europe.msteched.com/sessions © 2007 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.

4/14/2019 9:40 PM © 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. © 2009 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.

4/14/2019 9:40 PM © 2009 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.