You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/specs/#3483 - UserMessages.md
+101-8Lines changed: 101 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,9 @@ Post-action messages are displayed in both interactive and non-interactive modes
155
155
|`winget import`| Each package's `Pre*` shown, prompt Y/n per package | Each package's `Post*` shown | Follows the same per-package model |
156
156
| WinGet Configuration (DSC) | Displayed in log output, no prompt | Displayed in log output | Configuration is inherently non-interactive |
157
157
| Operation failure |`Pre*` shown before attempt |`Post*` NOT shown | Post-messages only appear on success |
158
-
|`disableInstallNotes` setting enabled |`Pre*` still shown (not affected) |`Post*` suppressed | Pre-messages are operational; post-messages are informational |
158
+
|`disableInstallNotes` setting enabled |`Pre*` still shown (not affected) |`Post*` still shown (controlled by `userMessages` settings, not `disableInstallNotes`) | Legacy setting does not affect new fields |
159
+
|`userMessages.disablePostActionMessages` enabled |`Pre*` still shown |`Post*` suppressed | New setting for new fields |
160
+
|`userMessages.disablePreActionMessages` enabled |`Pre*` suppressed, no prompt |`Post*` still shown | Suppresses both display and prompt |
159
161
160
162
#### Bulk Operations (`upgrade --all`, `import`)
161
163
@@ -165,16 +167,32 @@ A future enhancement could aggregate pre-messages and present them as a summary
165
167
166
168
### Settings
167
169
168
-
The existing `installBehavior.disableInstallNotes` setting is extended:
170
+
A new `userMessages` settings object is introduced under the root of the WinGet settings file. The existing `installBehavior.disableInstallNotes` setting is **not modified** and continues to control only the legacy `InstallationNotes` field.
169
171
170
-
| Setting | Current behavior | New behavior |
171
-
|---------|-----------------|-------------|
172
-
|`disableInstallNotes: true`| Suppresses `InstallationNotes` after install | Suppresses all `Post*` messages (`PostInstall`, `PostUpgrade`, `PostUninstall`) |
173
-
|`disableInstallNotes: false` (default) | Shows `InstallationNotes` after install | Shows all `Post*` messages |
172
+
```json
173
+
{
174
+
"userMessages": {
175
+
"disablePreActionMessages": false,
176
+
"disablePostActionMessages": false
177
+
}
178
+
}
179
+
```
180
+
181
+
| Setting | Default | Description |
182
+
|---------|---------|-------------|
183
+
|`userMessages.disablePreActionMessages`|`false`| When `true`, suppresses all pre-action messages (`PreInstall`, `PreUpgrade`, `PreUninstall`) and their associated prompts. The operation proceeds as if the user confirmed. |
184
+
|`userMessages.disablePostActionMessages`|`false`| When `true`, suppresses all post-action messages (`PostInstall`, `PostUpgrade`, `PostUninstall`). |
174
185
175
-
Pre-action messages are not affected by this setting because they serve an operational purpose (informing users before a potentially impactful action).
186
+
**Interaction with existing settings:**
176
187
177
-
> **Future consideration:** If community feedback indicates a need, a separate `disablePreActionMessages` setting could be added. This is not included in this specification.
The two settings are independent. `disableInstallNotes` governs the legacy field; `userMessages.disablePostActionMessages` governs the new fields. This avoids changing the meaning of an existing setting and gives users granular control during the transition period.
COM consumers are responsible for their own interactivity model. The WinGet COM API does not prompt — it returns the data and the consumer decides how to handle it.
202
220
221
+
### PowerShell Cmdlets
222
+
223
+
The WinGet PowerShell module cmdlets consume the COM API and must surface `UserMessages` appropriately.
224
+
225
+
#### Affected Cmdlets
226
+
227
+
| Cmdlet | Pre-message field | Post-message field |
The following information has been provided by the package publisher:
242
+
243
+
This package requires 2 GB of disk space and will modify your PATH.
244
+
245
+
Do you wish to continue?
246
+
[Y] Yes [N] No (default is "Y"):
247
+
```
248
+
249
+
The prompt uses `$Host.UI.PromptForChoice` (or equivalent) to integrate with PowerShell's native prompting, supporting `-Confirm` and `-WhatIf` patterns where applicable.
250
+
251
+
#### Non-Interactive / Pipeline Behavior
252
+
253
+
When running non-interactively (e.g., in a script with no host, or when the user passes `-Force`), pre-action messages are written to the verbose stream (`Write-Verbose`) and the operation proceeds without prompting:
VERBOSE: Publisher message (PreInstall): This package requires 2 GB of disk space and will modify your PATH.
258
+
```
259
+
260
+
Post-action messages are written to the information stream (`Write-Information`) so they appear by default but can be suppressed with `-InformationAction SilentlyContinue`.
261
+
262
+
#### Output Object
263
+
264
+
The result objects returned by cmdlets should include UserMessages in their output when present:
Write-Host "Note from publisher: $($result.UserMessages.PostInstall)" -ForegroundColor Yellow
280
+
}
281
+
```
282
+
283
+
#### Find-WinGetPackage / Show-WinGetPackage
284
+
285
+
The `Show-WinGetPackage` (or `Get-WinGetPackage`) cmdlet should include `UserMessages` in its output when displaying package metadata, allowing users to review messages before deciding to install:
0 commit comments