ps/Modules/Alkami.PowerShell.Choco/Public/Test-ManualChocoCommandsExecuted.ps1

29 lines
1.0 KiB
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
function Test-ManualChocoCommandsExecuted {
<#
.SYNOPSIS
Verifies that the packages installed through the build-server were successfully installed.
Checks that Install-ManualChocoPackages was executed, and the command file was renamed.
.PARAMETER CommandsPath
[string] Indicate where the chocoInstallCommands file is located
#>
[CmdletBinding()]
[OutputType([System.Boolean])]
Param(
[Parameter(Mandatory=$false)]
[string]$CommandsPath = "C:/temp/deploy/chocoInstallCommands.ps1"
)
$logLead = (Get-LogLeadName)
# Make sure that the manual package install command was run.
if(!(Test-Path $CommandsPath)) {
Write-Host "$logLead Chocolatey install script $CommandsPath was not found. This is acceptable."
return $true
} else {
Write-Error "$logLead The chocolatey install script at $CommandsPath was not executed and renamed. Run Install-ManualChocoPackages, or rename the file if you know what you are doing."
return $false
}
}