Creating Module
This commit is contained in:
32
Private/Test-ConfigurationDataItemKeyMatch.ps1
Normal file
32
Private/Test-ConfigurationDataItemKeyMatch.ps1
Normal file
@@ -0,0 +1,32 @@
|
||||
function Test-ConfigurationDataItemKeyMatch {
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[AllowNull()]
|
||||
$Left,
|
||||
[AllowNull()]
|
||||
$Right,
|
||||
[Parameter(Mandatory=$true)]
|
||||
[String[]]
|
||||
$KeyNames
|
||||
)
|
||||
|
||||
if($KeyNames.Count -eq 0){
|
||||
return $false
|
||||
}
|
||||
|
||||
foreach($KeyName in $KeyNames){
|
||||
if(-not (Test-ConfigurationDataItemContainsKey -Item $Left -KeyName $KeyName)){
|
||||
return $false
|
||||
}
|
||||
|
||||
if(-not (Test-ConfigurationDataItemContainsKey -Item $Right -KeyName $KeyName)){
|
||||
return $false
|
||||
}
|
||||
|
||||
if((Get-ConfigurationDataItemValue -Item $Left -KeyName $KeyName) -ne (Get-ConfigurationDataItemValue -Item $Right -KeyName $KeyName)){
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
return $true
|
||||
}
|
||||
Reference in New Issue
Block a user