Create private helper function New-Map
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
function New-Map {
|
||||
[CmdletBinding()]
|
||||
[OutputType([Hashtable])]
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
$inputObject,
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$key,
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$value
|
||||
)
|
||||
|
||||
$returnMap = @{ }
|
||||
foreach ($item in $inputObject) {
|
||||
$returnMap[$item.$key] = $item.$value
|
||||
}
|
||||
$returnMap
|
||||
}
|
||||
Reference in New Issue
Block a user