PowerShell Bulk App Installer Script
Ninichoco generates a self-contained PowerShell .ps1 script that installs each of your selected apps silently, logs progress, and prints a summary when done. This page explains what the script does so you can review it before running it on a machine you manage.
What the script does
- 1. Checks that it is running as Administrator and self-elevates if not
- 2. Detects whether the selected package manager (WinGet or Chocolatey) is installed
- 3. Loops through each selected app and installs it silently
- 4. Catches errors per-app so one failure does not stop the rest
- 5. Prints a summary table of successes and failures at the end
Script parameters
Three optional switch parameters control script behaviour:
| Parameter | Default | Description |
|---|---|---|
| -DryRun | off | Print what would be installed without actually installing |
| -StopOnError | off | Stop the script if any single app fails to install |
| -VerboseOutput | off | Print additional diagnostic output during installation |
.\install-ninichoco.ps1 -DryRun
.\install-ninichoco.ps1 -StopOnError -VerboseOutputAdmin self-elevation
The script checks [Security.Principal.WindowsIdentity]::GetCurrent() and relaunches itself with Start-Process powershell -Verb RunAs if it is not already running as Administrator. Both WinGet and Chocolatey require admin privileges to install software machine-wide.
Package manager detection
Before installing anything, the script verifies that the required package manager is available:
- For WinGet: checks
Get-Command winget - For Chocolatey: checks
Get-Command choco
If the package manager is missing, the script prints a clear error with installation instructions and exits without attempting any installs.
The install loop
Apps are defined as a PSCustomObject array — not string-interpolated commands. This means no user input ever reaches a command string. Each app object carries only its display name and verified package ID from the Ninichoco catalog:
$apps = @(
[PSCustomObject]@{ Name = "Google Chrome"; Id = "Google.Chrome" }
[PSCustomObject]@{ Name = "Visual Studio Code"; Id = "Microsoft.VisualStudioCode" }
)
foreach ($app in $apps) {
winget install --id $app.Id --silent --accept-package-agreements --accept-source-agreements
}Each install is wrapped in a try/catch block. Failures are recorded but do not stop subsequent installs (unless -StopOnError is set).
The summary table
After all installs complete, the script prints a results table:
─────────────────────────────────────────────
App Status
─────────────────────────────────────────────
Google Chrome ✓ Installed
Visual Studio Code ✓ Installed
7-Zip ✗ Failed
─────────────────────────────────────────────
2 succeeded · 1 failedHow to run the script
Download the script from Ninichoco, then open PowerShell as Administrator. If your machine blocks unsigned scripts, set the execution policy first:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserThen run the script:
.\install-ninichoco.ps1Or use the one-liner to download and run in a single command, without saving a file:
irm https://www.ninichoco.com/api/script?apps=google-chrome,visual-studio-code&mode=winget | iexLearn more about WinGet and Chocolatey.