Write PowerShell commands to silently install or update software
Unattended install or update commands for Windows using winget or Chocolatey, with verification and a fallback when silent install isn't possible.
The prompt
Write PowerShell commands to silently install or update software on Windows.
Software: [NAME(S) and edition - e.g. "7-Zip", "Google Chrome Enterprise", "VS Code (system install)"]
Target machines: [Windows 10 / 11, x64 or ARM, domain-joined or not]
Package managers available: [winget / Chocolatey / none]
Install scope: [per-user / all users]
How it will run: [manually as admin / Intune / Group Policy / RMM tool / scheduled task]
Approach, in this order of preference:
1. winget: give the command with the exact package ID, --silent, scope, and agreement flags. Mark the package ID [CONFIRM] and show me how to verify it with `winget search` or `winget show`.
2. Chocolatey, if it's not on winget.
3. The vendor's official installer with its documented silent switches (MSI: msiexec /qn /norestart; EXE: vendor-specific). Only use official download sources, and tell me where to confirm the switches in the vendor's documentation.
4. If silent install isn't supported, say so and give the shortest manual steps.
Also give me:
- A version check before and after, and how to update instead of reinstall.
- Exit codes to treat as success (e.g. 0, 3010 for reboot required).
- Logging to a file so failures can be diagnosed.
- A combined script if I listed several apps, which continues past failures and prints a summary.
Do not disable security features, bypass execution policy permanently, or download from unofficial mirrors. Recommend testing on one machine before deploying widely.
Highlighted [brackets] are blanks to replace with your own details.
Fill in the blanks and use this promptMore Software Development prompts
What to fill in
- Windows 10 / 11, x64 or ARM, domain-joined or not
- winget / Chocolatey / none
- per-user / all users
- CONFIRM
How this prompt is built
This prompt follows the Few-Shot structure (Few-shot prompting). A few-shot prompt includes one or more worked examples of the input and the output you want, so the model can copy the pattern instead of guessing it.
Related prompts
- Diagnose and improve my mobile app's performanceA performance review of an iOS or Android app covering startup time, jank, memory, battery, network, and crashes, with tools and a fix plan.
- Write and explain a regular expressionBuilds a regex from a description, explains it piece by piece, and tests it.
- Write kind, actionable review comments on a teammate's pull requestTurns your rough review notes into clear comments labeled by severity, so the author knows what blocks merging and what doesn't.
- Write precise TypeScript types for my data and APIsSafer, readable TypeScript types that rule out impossible states, replace unsafe casts, and come with compile-time tests.