25 lines
529 B
PowerShell
25 lines
529 B
PowerShell
function Get-ConfigurationDataArraySearchItem {
|
|
[CmdletBinding()]
|
|
Param(
|
|
[AllowNull()]
|
|
$Item
|
|
)
|
|
|
|
if($null -eq $Item){
|
|
return $null
|
|
}
|
|
|
|
if(-not (
|
|
($Item -is [System.Collections.Hashtable]) -or
|
|
($Item -is [System.Collections.Specialized.OrderedDictionary])
|
|
)){
|
|
return $null
|
|
}
|
|
|
|
return @(
|
|
$Item.GetEnumerator() |
|
|
Where-Object { ($_.Value -is [String]) -and ($_.Name -like "*Name") } |
|
|
Select-Object -First 1
|
|
)[0]
|
|
}
|