ps/Modules/Alkami.PowerShell.Configuration/Public/Test-AlkamiRepositoryManifest10.ps1

31 lines
1.1 KiB
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
function Test-AlkamiRepositoryManifest10 {
<#
.SYNOPSIS
Please don't use this file by hand, please use Test-AlkamiManifest
This function is intended to validate the RepositoryManifest dotted object/hashtable so we can ensure that the values provided meet a minimum standard of valid
.PARAMETER RepositoryManifest
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]$RepositoryManifest
)
$success = $true
$resultMessages = @()
$validWebTierInstall = Get-ValidWebTierInstallLocations
if ([string]::IsNullOrWhiteSpace($RepositoryManifest.appInstall) -or -not ($validWebTierInstall -contains $RepositoryManifest.appInstall)) {
$resultMessages += "packageManifest/repositoryManifest/appInstall contains an invalid value. Valid values are $($validWebTierInstall -join ',')"
$success = $false
}
return @{
success = $success
results = $resultMessages
}
}