ps/Modules/Alkami.PowerShell.Configuration/Public/Test-AlkamiLegacyUtilityManifest10.ps1
2023-05-30 22:51:22 -07:00

30 lines
1.0 KiB
PowerShell

function Test-AlkamiLegacyUtilityManifest10 {
<#
.SYNOPSIS
Please don't use this file by hand, please use Test-AlkamiManifest
This function is intended to validate the LegacyUtilityManifest dotted object/hashtable so we can ensure that the values provided meet a minimum standard of valid
.PARAMETER LegacyUtilityManifest
A dotted object ([xml](Get-Content -Path $somePath)) or hashtable of values
#>
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
Param(
[Parameter(Position = 0, Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[object]$LegacyUtilityManifest
)
$success = $true
$resultMessages = @()
if (-not [string]::IsNullOrWhiteSpace($LegacyUtilityManifest.needsShared) -and -not (@('true','false') -contains $LegacyUtilityManifest.needsShared)) {
$resultMessages += "packageManifest/legacyUtilityManifest/needsShared must be true or false"
$success = $false
}
return @{
success = $success
results = $resultMessages
}
}