Creating Module
This commit is contained in:
20
Private/Get-ConfigurationDataItemValue.ps1
Normal file
20
Private/Get-ConfigurationDataItemValue.ps1
Normal file
@@ -0,0 +1,20 @@
|
||||
function Get-ConfigurationDataItemValue {
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[AllowNull()]
|
||||
$Item,
|
||||
[Parameter(Mandatory=$true)]
|
||||
[String]
|
||||
$KeyName
|
||||
)
|
||||
|
||||
if(-not (Test-ConfigurationDataItemContainsKey -Item $Item -KeyName $KeyName)){
|
||||
return $null
|
||||
}
|
||||
|
||||
if($Item -is [System.Collections.IDictionary]){
|
||||
return $Item[$KeyName]
|
||||
}
|
||||
|
||||
return $Item.$KeyName
|
||||
}
|
||||
Reference in New Issue
Block a user