Creating Module
This commit is contained in:
24
Private/Get-ConfigurationDataArraySearchItem.ps1
Normal file
24
Private/Get-ConfigurationDataArraySearchItem.ps1
Normal file
@@ -0,0 +1,24 @@
|
||||
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]
|
||||
}
|
||||
Reference in New Issue
Block a user