Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
1.3 kB
4
Indexable
Never
# Next up install PSAE 2020
#

$findApp = Get-Package -name "PPC Practice Aids Single Audits (8-20)" -ErrorAction SilentlyContinue

# Check if program is installed. If it is not, then..
Write-Host "Checking to see if PNPE 2023 is installed"

if (!$findApp) {
	New-Item -Path "c:\workdir" -Name "pnpe23" -ItemType "directory" | Out-Null
	Copy-Item -Path "\\lerchfs01\ND\PPCAdminInstalls\PNPE\2023\01" -Destination "c:\workdir\pnpe23" -recurse -Force
	Rename-Item "c:\workdir\pnpe23\01\PPC Practice Aids Audits of Nonprofit Organizations (1-23).msi" "c:\workdir\pnpe23\01\pnpe.msi" 
	$programPath = "c:\workdir\pnpe23\01\pnpe.msi" 
	Start-Process msiexec.exe -Wait -ArgumentList "/I $programPath /quiet"
  $verifyInstalled = Get-Package -name "PPC Practice Aids Audits of Nonprofit Organizations (1-23)" -ErrorAction SilentlyContinue
  if (!$verifyInstalled) {
	  Write-Host "FAILED TO INSTALL: PPC Practice Aids Audits of Nonprofit Organizations (1-23)"
	  exit 1
  } else {
	  Write-Host "PPC Practice Aids Audits of Nonprofit Organizations (1-23) installed successfully."
	  Write-Host ""
  }
} else { 
  Write-Host "PPC Practice Aids Audits of Nonprofit Organizations (1-23) is already installed."
  Write-Host ""
}

Clear-Variable -name findApp
Clear-Variable -name verifyInstalled

#