Skip to content

Commit 4fb96b5

Browse files
author
Steve Lee (POWERSHELL HE/HIM) (from Dev Box)
committed
fix tests
1 parent 96d7837 commit 4fb96b5

File tree

12 files changed

+1020
-1339
lines changed

12 files changed

+1020
-1339
lines changed

resources/WindowsUpdate/README.md

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Microsoft.Windows/Updates DSC Resource
1+
# Microsoft.Windows/UpdateList DSC Resource
22

33
## Overview
44

5-
The `Microsoft.Windows/Updates` resource enables querying information about Windows Updates using the Windows Update Agent COM APIs. This resource allows you to retrieve detailed information about specific updates available on or installed on a Windows system.
5+
The `Microsoft.Windows/UpdateList` resource enables querying information about Windows Updates using the Windows Update Agent COM APIs. This resource allows you to retrieve detailed information about specific updates available on or installed on a Windows system.
66

77
## Features
88

@@ -33,7 +33,9 @@ The `get` operation searches for a Windows Update by title (supports partial mat
3333

3434
```json
3535
{
36-
"title": "Security Update"
36+
"updates": [{
37+
"title": "Security Update"
38+
}]
3739
}
3840
```
3941

@@ -44,25 +46,28 @@ The `get` operation searches for a Windows Update by title (supports partial mat
4446
$schema: https://aka.ms/dsc/schemas/v3/configuration.json
4547
resources:
4648
- name: QuerySecurityUpdate
47-
type: Microsoft.Windows/Updates
49+
type: Microsoft.Windows/UpdateList
4850
properties:
49-
title: "Security Update for Windows"
51+
updates:
52+
- title: "Security Update for Windows"
5053
```
5154
5255
#### Output Example
5356
5457
```json
5558
{
56-
"title": "2024-01 Security Update for Windows 11 Version 22H2 for x64-based Systems (KB5034123)",
57-
"isInstalled": true,
58-
"description": "Install this update to resolve issues in Windows...",
59-
"id": "12345678-1234-1234-1234-123456789abc",
60-
"isUninstallable": true,
61-
"KBArticleIDs": ["5034123"],
62-
"maxDownloadSize": 524288000,
63-
"msrcSeverity": "Critical",
64-
"securityBulletinIds": ["MS24-001"],
65-
"updateType": "Software"
59+
"updates": [{
60+
"title": "2024-01 Security Update for Windows 11 Version 22H2 for x64-based Systems (KB5034123)",
61+
"isInstalled": true,
62+
"description": "Install this update to resolve issues in Windows...",
63+
"id": "12345678-1234-1234-1234-123456789abc",
64+
"isUninstallable": true,
65+
"kbArticleIds": ["5034123"],
66+
"minDownloadSize": 524288000,
67+
"msrcSeverity": "Critical",
68+
"securityBulletinIds": ["MS24-001"],
69+
"updateType": "Software"
70+
}]
6671
}
6772
```
6873

@@ -72,22 +77,27 @@ resources:
7277

7378
| Property | Type | Required | Description |
7479
|----------|--------|----------|------------------------------------------------|
75-
| title | string | Yes | The title or partial title of the update to search for |
80+
| updates | array | Yes | Array of update filter objects |
81+
| updates[].title | string | No | The title or partial title of the update to search for |
82+
| updates[].id | string | No | The unique identifier (GUID) for the update |
7683

7784
### Output Properties
7885

86+
The resource returns an UpdateList object containing an array of updates:
87+
7988
| Property | Type | Description |
8089
|-----------------------|-----------------|-------------------------------------------------------|
81-
| title | string | The full title of the Windows Update |
82-
| isInstalled | boolean | Whether the update is currently installed |
83-
| description | string | Detailed description of the update |
84-
| id | string | Unique identifier (GUID) for the update |
85-
| isUninstallable | boolean | Whether the update can be uninstalled |
86-
| KBArticleIDs | array[string] | Knowledge Base article identifiers |
87-
| maxDownloadSize | integer (int64) | Maximum download size in bytes |
88-
| msrcSeverity | enum | MSRC severity: Critical, Important, Moderate, or Low |
89-
| securityBulletinIds | array[string] | Security bulletin identifiers |
90-
| updateType | enum | Type of update: Software or Driver |
90+
| updates | array | Array of update objects |
91+
| updates[].title | string | The full title of the Windows Update |
92+
| updates[].isInstalled | boolean | Whether the update is currently installed |
93+
| updates[].description | string | Detailed description of the update |
94+
| updates[].id | string | Unique identifier (GUID) for the update |
95+
| updates[].isUninstallable | boolean | Whether the update can be uninstalled |
96+
| updates[].kbArticleIds | array[string] | Knowledge Base article identifiers |
97+
| updates[].minDownloadSize | integer (int64) | Minimum download size in bytes |
98+
| updates[].msrcSeverity | enum | MSRC severity: Critical, Important, Moderate, or Low |
99+
| updates[].securityBulletinIds | array[string] | Security bulletin identifiers |
100+
| updates[].updateType | enum | Type of update: Software or Driver |
91101

92102
## Implementation Details
93103

@@ -123,7 +133,7 @@ To test the resource manually:
123133

124134
```powershell
125135
# Create input JSON
126-
$input = @{ title = "Security Update" } | ConvertTo-Json
136+
$input = @{ updates = @(@{ title = "Security Update" }) } | ConvertTo-Json -Depth 3
127137
128138
# Query for an update
129139
$input | .\wu_dsc.exe get

0 commit comments

Comments
 (0)