Skip to content

winget_install_package.ps1

Corey Watson edited this page Dec 19, 2025 · 1 revision

winget_install_package.ps1

Installs a software package using winget with SuperOps runtime variable replacement.

Overview

Property Value
Platform Windows
Version 1.0.0
Category Installation & Updates

Purpose

Installs a software package using winget (Windows Package Manager). Uses SuperOps runtime text replacement for the package name. Handles silent installation with automatic acceptance of agreements.

Requirements

  • Winget must be installed
  • Administrator privileges recommended
  • Internet connectivity

Inputs

Variable Description Required
$PackageName SuperOps runtime replacement variable for winget package ID (e.g., "Google.Chrome", "Mozilla.Firefox") Yes

Behavior

  1. Validates software name input
  2. Checks winget availability
  3. Installs package silently with --accept-package-agreements and --accept-source-agreements
  4. Reports installation result

Exit Codes

Code Description
0 Success - package installed
1 Failure - installation failed or winget unavailable

Notes

  • Silent installation mode
  • Accepts package and source agreements automatically
  • Handles SYSTEM context winget detection
  • Recognizes "already installed" status as success

Example Output

[ INPUT VALIDATION ]
--------------------------------------------------------------
Package ID      : Google.Chrome

[ WINGET CHECK ]
--------------------------------------------------------------
Winget          : Available
Version         : v1.7.10861

[ INSTALLATION ]
--------------------------------------------------------------
Installing Google.Chrome...
Installation complete

[ FINAL STATUS ]
--------------------------------------------------------------
Status          : Success
Package         : Google.Chrome installed

[ SCRIPT COMPLETED ]
--------------------------------------------------------------

Changelog

  • 2025-12-03 v1.0.0 Initial release - winget package installer for SuperOps

Clone this wiki locally