12
Click to edit Master subtitle style 06 | The Pipeline : Deeper Jeffrey Snover | Distinguished Engineer & Lead Architect Jason Helmick | Senior Technologist, Concentrated Technology

Jeffrey Snover | Distinguished Engineer & Lead Architect

  • Upload
    bowen

  • View
    74

  • Download
    0

Embed Size (px)

DESCRIPTION

06 | The Pipeline : Deeper. Jeffrey Snover | Distinguished Engineer & Lead Architect Jason Helmick | Senior Technologist, Concentrated Technology. Course Topics. Module Overview. How the pipeline really works - The 4 step solution ByValue ByPropertyName - PowerPoint PPT Presentation

Citation preview

Page 1: Jeffrey Snover | Distinguished Engineer & Lead Architect

Click to edit Master subtitle style

06 | The Pipeline : DeeperJeffrey Snover | Distinguished Engineer & Lead ArchitectJason Helmick | Senior Technologist, Concentrated Technology

Page 2: Jeffrey Snover | Distinguished Engineer & Lead Architect

Course Topics

Getting Started with PowerShell01 | Don’t fear the shell 06 | The pipeline : Deeper

02 | The Help system 07 | The Power in the Shell - Remoting

03 | The pipeline : Getting connected

08 | Getting prepared for automation

04 | Extending the shell 09 | Automation in scale - Remoting

05 | Objects for the Admin 10 | Introducing scripting and toolmaking

Page 3: Jeffrey Snover | Distinguished Engineer & Lead Architect

• How the pipeline really works - The 4 step solution1. ByValue2. ByPropertyName3. What if my property doesn’t match – Customize it!4. The Parenthetical – when all else fails

Module Overview

Page 4: Jeffrey Snover | Distinguished Engineer & Lead Architect

How the pipeline really works - The 4 step solution

Page 5: Jeffrey Snover | Distinguished Engineer & Lead Architect

ByValue1. Get-Service passes ServiceController objects to the pipeline

2. Does Stop-Service accept ServiceController Objects?

3. Help Stop-Service -Fulldisplays a parameter that accepts ServiceController ByValue

Page 6: Jeffrey Snover | Distinguished Engineer & Lead Architect

ByPropertyName

Page 7: Jeffrey Snover | Distinguished Engineer & Lead Architect

ByPropertyName

2. Stop-Service does not support accepting “Process” objects ByValue, so PowerShell checks what can be accepted ByPropertyName.

1. Get-Process is passing a “Process” Object

3. -Name does accept strings ByPropertyName, and the objects in the pipeline are labeled as a Name property4. Stop-Service attempts to use the objects for its -Name, in this example, fails

Page 8: Jeffrey Snover | Distinguished Engineer & Lead Architect

What if my property doesn’t match – Customize it!

Page 9: Jeffrey Snover | Distinguished Engineer & Lead Architect

The Parenthetical – when all else fails

Parenthesis don’t rely on binding and attach information directly to the desired parameter.

1. I want to pass a list of computer names to Get-Service. Why does this fail?

2. -Name and -InputObject accept pipeline input ByValue, not -Computername. -Name accepts text, and then causes the failure.

Page 10: Jeffrey Snover | Distinguished Engineer & Lead Architect

The Parenthetical – when all else fails

Returns a collection (table) of objects.

Returns string contents

Page 11: Jeffrey Snover | Distinguished Engineer & Lead Architect

Questions or comments?

Page 12: Jeffrey Snover | Distinguished Engineer & Lead Architect

©2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics 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.