Created
June 26, 2019 06:36
-
-
Save goyalmohit/0b7c16eb39199873728a9f776fc8b1b9 to your computer and use it in GitHub Desktop.
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 Get-PersonDetails { | |
Begin { | |
Write-Verbose "In Begin Block: Get-PersonDetails" | |
$PersonName = @() | |
$PersonAge = @() | |
} | |
Process{ | |
Write-Verbose "In Process Block: Get-PersonDetails" | |
$PersonName = "Keith", "Eddy", "Kevin", "Kate" | |
$PersonAge = 29, 34, 23, 15 | |
} | |
End{ | |
Write-Verbose "In End Block: Get-PersonDetails" | |
return $PersonName, $PersonAge | |
} | |
} | |
$PersonName = @() | |
$PersonAge = @() | |
$PersonName, $PersonAge = Get-PersonDetails | |
foreach($item in 0..3){ | |
Write-Host "$($PersonName[$item]) is $($PersonAge[$item]) years old" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment