function Install-ManualChocoPackages { <# .SYNOPSIS Runs a chocolatey install script for packages that must be installed manually. For now this includes new packages, and packages that have database migrations. #> [CmdletBinding()] Param( [Parameter(Mandatory=$false)] [string]$commandsPath = "C:/temp/deploy/chocoInstallCommands.ps1" ) $logLead = (Get-LogLeadName); if(!(Test-Path $commandsPath)) { Write-Warning "$logLead Chocolatey install script $commandsPath was not found." } else { Write-Host "$logLead Executing install script at $commandsPath" & $commandsPath Write-Host "$logLead Install script has run successfully. Backing up choco commands file." $fileInfo = Get-ChildItem $commandsPath $newPath = Join-Path $fileInfo.DirectoryName ("backup-" + $fileInfo.Name) Write-Host "$logLead Saving backup choco command file to $newPath" Move-Item -Path $commandsPath -Destination $newPath -force Write-Host "$logLead Backup complete." } }