Created
July 26, 2012 21:44
-
-
Save naraga/3184751 to your computer and use it in GitHub Desktop.
Yeilding objects and arrays to pipe.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetFewObjs() | |
{ | |
New-Object PSObject -p @{ | |
Name = "Bill" | |
Surname = "Gates" | |
} | |
New-Object PSObject -p @{ | |
Name = "Barack" | |
Surname = "Obama" | |
} | |
@( | |
New-Object PSObject -p @{ | |
Name = "John" | |
Surname = "Doe" | |
} | |
New-Object PSObject -p @{ | |
Name = "Ferko" | |
Surname = "Mrkva" | |
} | |
) | |
} | |
GetFewObjs |% {"$($_.Name), $($_.Surname)"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetFewObjs() | |
{ | |
New-Object PSObject -p @{ | |
Name = "Bill" | |
Surname = "Gates" | |
} | |
New-Object PSObject -p @{ | |
Name = "Barack" | |
Surname = "Obama" | |
} | |
@( | |
New-Object PSObject -p @{ | |
Name = "John" | |
Surname = "Doe" | |
} | |
New-Object PSObject -p @{ | |
Name = "Ferko" | |
Surname = "Mrkva" | |
} | |
) | |
} | |
GetFewObjs |% {"$($_.Name), $($_.Surname)"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetFewObjs() | |
{ | |
New-Object PSObject -p @{ | |
Name = "Bill" | |
Surname = "Gates" | |
} | |
New-Object PSObject -p @{ | |
Name = "Barack" | |
Surname = "Obama" | |
} | |
@( | |
New-Object PSObject -p @{ | |
Name = "John" | |
Surname = "Doe" | |
} | |
New-Object PSObject -p @{ | |
Name = "Ferko" | |
Surname = "Mrkva" | |
} | |
) | |
} | |
GetFewObjs |% {"$($_.Name), $($_.Surname)"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment