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

06 the pipeline-deeper

Embed Size (px)

Citation preview

Page 1: 06  the pipeline-deeper

Click to edit Master subtitle style

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

Page 2: 06  the pipeline-deeper

Course Topics

Getting Started with PowerShell

01 | Don’t fear the shell 06 | The pipeline : Deeper

02 | The Help system07 | The Power in the Shell - Remoting

03 | The pipeline : Getting connected

08 | Getting prepared for automation

04 | Extending the shell09 | Automation in scale - Remoting

05 | Objects for the Admin10 | Introducing scripting and toolmaking

Page 3: 06  the pipeline-deeper

• How the pipeline really works - The 4 step solution

1. ByValue

2. ByPropertyName

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

4. The Parenthetical – when all else fails

Module Overview

Page 4: 06  the pipeline-deeper

How the pipeline really works - The 4 step solution

Page 5: 06  the pipeline-deeper

ByValue

1. 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: 06  the pipeline-deeper

ByPropertyName

Page 7: 06  the pipeline-deeper

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 property

4. Stop-Service attempts to use the objects for its -Name, in this example, fails

Page 8: 06  the pipeline-deeper

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

Page 9: 06  the pipeline-deeper

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: 06  the pipeline-deeper

The Parenthetical – when all else fails

Returns a collection (table) of objects.

Returns string contents

Page 11: 06  the pipeline-deeper

Questions or comments?

Page 12: 06  the pipeline-deeper

©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.