I am writing a function that returns an id, name pair.
I would like to do something like
$a = get-name-id-pair()
$a.Id
$a.Name
like
I use this for keeping track of sites/directories when working on multiple domains. It is possible to initialise the array when declaring it rather than adding each entry separately:
$domain = $env:userdnsdomain
$siteUrls = @{ 'TEST' = 'http://test/SystemCentre'
'LIVE' = 'http://live/SystemCentre' }
$url = $siteUrls[$domain]