fleet/ee/maintained-apps/inputs/winget/scripts/postman_install.ps1
Allen Houchins cbec69c649
Add Postman as a Windows FMA (#37227)
This pull request adds support for managing the installation and
uninstallation of Postman on Windows via Winget, and simplifies the
associated PowerShell scripts. The changes introduce a new Postman app
definition, refactor the install and uninstall scripts to remove
unnecessary complexity, and update the Postman icon in the frontend to
use a PNG image.

**Postman app management support:**

* Added a new `postman.json` manifest in
`ee/maintained-apps/inputs/winget/` to define Postman as a managed
application, including install/uninstall script paths and package
metadata.

**PowerShell script simplification:**

* Refactored `postman_install.ps1` to remove scheduled task logic and
run the installer directly with the `--silent` flag, improving
reliability and maintainability.
* Simplified `postman_uninstall.ps1` to directly search for and execute
the uninstall command for Postman, supporting silent uninstallation and
removing scheduled task and logging logic.

**Frontend update:**

* Updated the `Postman.tsx` icon component to use a PNG image instead of
inline SVG paths, ensuring consistency with other icon assets.
2025-12-12 23:17:32 -06:00

28 lines
No EOL
582 B
PowerShell

# Learn more about .exe install scripts:
# http://fleetdm.com/learn-more-about/exe-install-scripts
$exeFilePath = "${env:INSTALLER_PATH}"
try {
# Add argument to install silently
# Postman uses --silent for silent installation
$processOptions = @{
FilePath = "$exeFilePath"
ArgumentList = "--silent"
PassThru = $true
Wait = $true
}
# Start process and track exit code
$process = Start-Process @processOptions
$exitCode = $process.ExitCode
# Prints the exit code
Write-Host "Install exit code: $exitCode"
Exit $exitCode
} catch {
Write-Host "Error: $_"
Exit 1
}