Created
June 26, 2019 06:57
-
-
Save goyalmohit/ee8c828773a50d6b50e09d43c0d9a275 to your computer and use it in GitHub Desktop.
This file contains hidden or 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" | |
[hashtable] $PersonDetails = @{} | |
} | |
Process{ | |
Write-Verbose "In Process Block: Get-PersonDetails" | |
$PersonDetails = @{Keith=29; Eddy=24; Kevin=23; Kate=15} | |
} | |
End{ | |
Write-Verbose "In End Block: Get-PersonDetails" | |
return $PersonDetails | |
} | |
} | |
[hashtable] $PersonDetails = @{} | |
$PersonDetails = Get-PersonDetails | |
foreach($key in $PersonDetails.Keys){ | |
Write-Host "$key is $($PersonDetails[$key]) years old" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment