Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Do not hard-code deployment logic in orchestration functions.

## Catalogs

Driver packs: `catalogs/driverpack/` (XML/JSON, mirrored from OEM sources listed in `module.json`).
Driver packs: `core/driverpacks/` (XML/JSON, mirrored from OEM sources listed in `module.json`).
OS metadata: `catalogs/operatingsystem/` (named `<build>-<windows-version>.xml`).
Update catalog files when new OS builds or driver pack versions are released; do not edit them manually for content that should be fetched upstream.

Expand Down
20 changes: 10 additions & 10 deletions .github/instructions/osdcloud-catalog-update.instructions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: "Use when adding a new Windows OS build to catalogs/operatingsystem/, updating driver pack snapshots in catalogs/driverpack/, adding a new Surface model to microsoft.json, or adding a new Panasonic model to panasonic.json. Covers file naming, XML/JSON schemas, the build-number switch statement, and required workflow config changes."
description: "Use when adding a new Windows OS build to catalogs/operatingsystem/, updating driver pack snapshots in core/driverpacks/, adding a new Surface model to surface.json, or adding a new Panasonic model to panasonic.json. Covers file naming, XML/JSON schemas, the build-number switch statement, and required workflow config changes."
---

# Catalog Update Guidelines
Expand Down Expand Up @@ -90,7 +90,7 @@ Each `<File>` element contains:

---

## Driver pack catalogs (`catalogs/driverpack/`)
## Driver pack catalogs (`core/driverpacks/`)

### Overview of catalog files

Expand All @@ -99,7 +99,7 @@ Each `<File>` element contains:
| `dell.xml` | OEM XML snapshot | Dell | Download + replace |
| `hp.xml` | OEM XML snapshot | HP | Download + replace |
| `lenovo.xml` | OEM XML snapshot | Lenovo | Download + replace |
| `microsoft.json` | JSON array | Microsoft (Surface) | Manual edit / `Update-MicrosoftCatalog.ps1` |
| `surface.json` | JSON array | Microsoft (Surface) | Manual edit / `Update-MicrosoftCatalog.ps1` |
| `panasonic.json` | Nested JSON | Panasonic | Manual edit |
| `default.json` | JSON array | ARM64 / multi-OEM | Manual edit |

Expand All @@ -123,18 +123,18 @@ At runtime, `Get-OSDCloudCatalogDell/Hp/Lenovo` downloads the OEM CAB/XML to `$e
```

3. Replace the local file:
- `catalogs/driverpack/dell.xml`
- `catalogs/driverpack/hp.xml`
- `catalogs/driverpack/lenovo.xml`
- `core/driverpacks/dell.xml`
- `core/driverpacks/hp.xml`
- `core/driverpacks/lenovo.xml`

4. Do not edit the OEM XML content manually — it is consumed as-is by the catalog parser.

---

### microsoft.json (Surface driver packs — amd64 and arm64)
### surface.json (Surface driver packs — amd64 and arm64)

Used for `Manufacturer == 'Microsoft'` on both AMD64 and ARM64 devices.
Read directly by `Get-OSDCloudCatalogSurface`, which enriches entries with live MSI URLs from each entry's `UpdatePage` at runtime. **There is no `microsoft.xml` to regenerate.**
Read directly by `Get-OSDCloudCatalogSurface`, which enriches entries with live MSI URLs from each entry's `UpdatePage` at runtime. **There is no `surface.xml` to regenerate.**

`Update-MicrosoftCatalog.ps1` (run by the `update-catalog-microsoft.yaml` GitHub Actions workflow) scrapes all `UpdatePage` URLs and commits any changed MSI filenames, URLs, or release dates automatically each week.

Expand Down Expand Up @@ -205,7 +205,7 @@ This file uses a different nested schema compared to other driver pack catalogs.

### default.json (ARM64 and generic driver packs)

Used for ARM64 deployments (all manufacturers) and AMD64 devices that are not Dell, HP, Lenovo, or Microsoft. Uses the same flat JSON array schema as `microsoft.json`.
Used for ARM64 deployments (all manufacturers) and AMD64 devices that are not Dell, HP, Lenovo, or Microsoft. Uses the same flat JSON array schema as `surface.json`.

Key differences:
- `OSArchitecture` should be `"arm64"` for ARM64-only packs.
Expand All @@ -217,6 +217,6 @@ Key differences:
## Common mistakes

- **Omitting the build switch case** — a new OS XML will load without errors but produce zero OS options in the UX because every `<File>` hits the `default { continue }` branch.
- **Stale `microsoft.json` driver URLs** — `Get-OSDCloudCatalogSurface` serves MSI URLs from `microsoft.json`; if `UpdatePage` links change and the automated workflow has not run, deployed drivers may point to outdated or removed files. Run `Update-MicrosoftCatalog.ps1` manually to refresh.
- **Stale `surface.json` driver URLs** — `Get-OSDCloudCatalogSurface` serves MSI URLs from `surface.json`; if `UpdatePage` links change and the automated workflow has not run, deployed drivers may point to outdated or removed files. Run `Update-MicrosoftCatalog.ps1` manually to refresh.
- **Editing OEM XML snapshots manually** — Dell/HP/Lenovo XML is replaced wholesale from upstream; manual edits will be lost on the next snapshot refresh.
- **Adding a Windows version string to workflow configs without the catalog XML** — the UX will offer the version but `Get-OSDCloudCoreOperatingSystems` will return no matching ESD entries, causing `Initialize-OSDCloudDeploy` to throw.
28 changes: 14 additions & 14 deletions .github/prompts/osdcloud-update-driverpack-catalog.prompt.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: "Step-by-step guide for updating OSDCloud driver pack catalogs: refresh Dell/HP/Lenovo XML snapshots, add or update Surface models in microsoft.json, update panasonic.json, or add ARM64 entries to default.json."
description: "Step-by-step guide for updating OSDCloud driver pack catalogs: refresh Dell/HP/Lenovo XML snapshots, add or update Surface models in surface.json, update panasonic.json, or add ARM64 entries to default.json."
argument-hint: "dell | hp | lenovo | microsoft | panasonic | default | all"
agent: "agent"
---
Expand All @@ -12,12 +12,12 @@ If the user provided an argument, use it to determine which catalogs to update:

| Argument | Catalog file(s) |
|---|---|
| `dell` | `catalogs/driverpack/dell.xml` |
| `hp` | `catalogs/driverpack/hp.xml` |
| `lenovo` | `catalogs/driverpack/lenovo.xml` |
| `microsoft` | `catalogs/driverpack/microsoft.json` |
| `panasonic` | `catalogs/driverpack/panasonic.json` |
| `default` | `catalogs/driverpack/default.json` |
| `dell` | `core/driverpacks/dell.xml` |
| `hp` | `core/driverpacks/hp.xml` |
| `lenovo` | `core/driverpacks/lenovo.xml` |
| `microsoft` | `core/driverpacks/surface.json` |
| `panasonic` | `core/driverpacks/panasonic.json` |
| `default` | `core/driverpacks/default.json` |
| `all` | All of the above |

If no argument was provided, ask: **Which catalog(s) need updating?** (list the options above).
Expand All @@ -42,7 +42,7 @@ For each OEM XML catalog being refreshed:

3. **Replace the local snapshot**:
```powershell
Copy-Item "$env:TEMP\DriverPackCatalog.xml" 'catalogs\driverpack\dell.xml' -Force
Copy-Item "$env:TEMP\DriverPackCatalog.xml" 'core\driverpacks\dell.xml' -Force
```

4. **Do not edit the XML content** -- it is consumed as-is.
Expand All @@ -51,9 +51,9 @@ For each OEM XML catalog being refreshed:

---

## Microsoft (Surface) -- microsoft.json
## Microsoft (Surface) -- surface.json

`microsoft.json` is the sole source of truth for Surface driver packs. `Get-OSDCloudCatalogSurface` reads it directly at runtime and enriches entries from live download pages for models that have an `UpdatePage` URL. **There is no `microsoft.xml` to regenerate.**
`surface.json` is the sole source of truth for Surface driver packs. `Get-OSDCloudCatalogSurface` reads it directly at runtime and enriches entries from live download pages for models that have an `UpdatePage` URL. **There is no `surface.xml` to regenerate.**

### If adding or updating a model entry manually

Expand All @@ -74,12 +74,12 @@ Then:

1. Set `CatalogVersion` and `ReleaseDate` to today's date in `YY.MM.DD` format.
2. Set `Name` to `"Surface <Model> [<ReleaseDate>]"` (no "Microsoft" prefix in the Name field).
3. Edit `catalogs/driverpack/microsoft.json` -- insert the new entry in the correct position (sort by Model name).
3. Edit `core/driverpacks/surface.json` -- insert the new entry in the correct position (sort by Model name).
4. Confirm the file is saved.

### Automated update via GitHub Actions

The `update-catalog-microsoft.yaml` workflow runs `.github/scripts/Update-MicrosoftCatalog.ps1` every 4 hours and on demand. It scrapes every `UpdatePage` URL in `microsoft.json`, selects the best available MSI, and commits any changes automatically. Run `workflow_dispatch` to trigger an immediate update.
The `update-catalog-microsoft.yaml` workflow runs `.github/scripts/Update-MicrosoftCatalog.ps1` every 4 hours and on demand. It scrapes every `UpdatePage` URL in `surface.json`, selects the best available MSI, and commits any changes automatically. Run `workflow_dispatch` to trigger an immediate update.

---

Expand Down Expand Up @@ -110,7 +110,7 @@ Then:

## Default (ARM64 / generic) -- default.json

Ask the user for the new entry fields (same schema as `microsoft.json`):
Ask the user for the new entry fields (same schema as `surface.json`):
`CatalogVersion`, `ReleaseDate`, `Name`, `Manufacturer`, `Model`, `SystemId`, `FileName`, `Url`, `OperatingSystem`, `OSArchitecture`, `HashMD5`.

Rules:
Expand All @@ -125,7 +125,7 @@ Rules:
After all edits, confirm each item:

- [ ] OEM XML snapshots replaced (Dell/HP/Lenovo as applicable)
- [ ] `microsoft.json` edited (if applicable)
- [ ] `surface.json` edited (if applicable)
- [ ] `panasonic.json` updated with new `LastDateModified` (if applicable)
- [ ] `default.json` updated (if applicable)
- [ ] No manual edits made to Dell/HP/Lenovo XML content
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/update-catalog-dell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
& expand.exe $cabPath $xmlPath
Write-Host "Extracted: $((Get-Item $xmlPath).Length) bytes"

Copy-Item $xmlPath 'OSDCloud\catalogs\driverpack\dell.xml' -Force
Write-Host "Replaced OSDCloud\catalogs\driverpack\dell.xml"
Copy-Item $xmlPath 'OSDCloud\core\driverpacks\dell.xml' -Force
Write-Host "Replaced OSDCloud\core\driverpacks\dell.xml"

[xml]$xml = Get-Content 'OSDCloud\catalogs\driverpack\dell.xml' -Raw
[xml]$xml = Get-Content 'OSDCloud\core\driverpacks\dell.xml' -Raw
$version = $xml.DocumentElement.GetAttribute('version')
Write-Host "Dell catalog version: $version"

Expand All @@ -45,12 +45,12 @@ jobs:
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'

git add OSDCloud/catalogs/driverpack/dell.xml
git add OSDCloud/core/driverpacks/dell.xml

if (git diff --cached --quiet) {
Write-Host "No changes to commit."
} else {
[xml]$xml = Get-Content 'OSDCloud\catalogs\driverpack\dell.xml' -Raw
[xml]$xml = Get-Content 'OSDCloud\core\driverpacks\dell.xml' -Raw
$version = $xml.DocumentElement.GetAttribute('version')
git commit -m "chore(catalog): update Dell driver pack catalog ($version)"
git push
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/update-catalog-hp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
& expand.exe $cabPath $xmlPath
Write-Host "Extracted: $((Get-Item $xmlPath).Length) bytes"

Copy-Item $xmlPath 'OSDCloud\catalogs\driverpack\hp.xml' -Force
Write-Host "Replaced OSDCloud\catalogs\driverpack\hp.xml"
Copy-Item $xmlPath 'OSDCloud\core\driverpacks\hp.xml' -Force
Write-Host "Replaced OSDCloud\core\driverpacks\hp.xml"

$dateReleased = (Select-String -Path 'OSDCloud\catalogs\driverpack\hp.xml' -Pattern 'DateReleased="([^"]+)"' |
$dateReleased = (Select-String -Path 'OSDCloud\core\driverpacks\hp.xml' -Pattern 'DateReleased="([^"]+)"' |
Select-Object -First 1).Matches[0].Groups[1].Value
Write-Host "HP catalog DateReleased: $dateReleased"

Expand All @@ -45,12 +45,12 @@ jobs:
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'

git add OSDCloud/catalogs/driverpack/hp.xml
git add OSDCloud/core/driverpacks/hp.xml

if (git diff --cached --quiet) {
Write-Host "No changes to commit."
} else {
$dateReleased = (Select-String -Path 'OSDCloud\catalogs\driverpack\hp.xml' -Pattern 'DateReleased="([^"]+)"' |
$dateReleased = (Select-String -Path 'OSDCloud\core\driverpacks\hp.xml' -Pattern 'DateReleased="([^"]+)"' |
Select-Object -First 1).Matches[0].Groups[1].Value
git commit -m "chore(catalog): update HP driver pack catalog ($dateReleased)"
git push
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/update-catalog-lenovo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
Invoke-WebRequest -Uri 'https://download.lenovo.com/cdrt/td/catalogv2.xml' -OutFile $xmlPath -UseBasicParsing
Write-Host "Downloaded: $((Get-Item $xmlPath).Length) bytes"

Copy-Item $xmlPath 'OSDCloud\catalogs\driverpack\lenovo.xml' -Force
Write-Host "Replaced OSDCloud\catalogs\driverpack\lenovo.xml"
Copy-Item $xmlPath 'OSDCloud\core\driverpacks\lenovo.xml' -Force
Write-Host "Replaced OSDCloud\core\driverpacks\lenovo.xml"

[xml]$xml = Get-Content 'OSDCloud\catalogs\driverpack\lenovo.xml' -Raw
[xml]$xml = Get-Content 'OSDCloud\core\driverpacks\lenovo.xml' -Raw
$version = $xml.DocumentElement.GetAttribute('version')
Write-Host "Lenovo catalog version: $version"

Expand All @@ -40,12 +40,12 @@ jobs:
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'

git add OSDCloud/catalogs/driverpack/lenovo.xml
git add OSDCloud/core/driverpacks/lenovo.xml

if (git diff --cached --quiet) {
Write-Host "No changes to commit."
} else {
[xml]$xml = Get-Content 'OSDCloud\catalogs\driverpack\lenovo.xml' -Raw
[xml]$xml = Get-Content 'OSDCloud\core\driverpacks\lenovo.xml' -Raw
$version = $xml.DocumentElement.GetAttribute('version')
$date = (Get-Date -Format 'yyyy-MM-dd')
git commit -m "chore(catalog): update Lenovo driver pack catalog (v$version $date)"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-catalog-microsoft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
id: update
shell: pwsh
run: |
.\.github\scripts\Update-MicrosoftCatalog.ps1 -JsonPath 'OSDCloud\catalogs\driverpack\microsoft.json'
.\.github\scripts\Update-MicrosoftCatalog.ps1 -JsonPath 'OSDCloud\core\driverpacks\surface.json'

- name: Commit if changed
if: steps.update.outputs.changed == 'true'
Expand All @@ -31,7 +31,7 @@ jobs:
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'

git add OSDCloud/catalogs/driverpack/microsoft.json
git add OSDCloud/core/driverpacks/surface.json

if (git diff --cached --quiet) {
Write-Host "No changes to commit."
Expand Down
23 changes: 15 additions & 8 deletions OSDCloud/core/module.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
{
"default": {
"driverpackcataloglocal": "core\\driverpacks\\default.json"
},
"dell": {
"driverpackcataloglocal": "catalogs\\driverpack\\dell.xml",
"driverpackcataloglocal": "core\\driverpacks\\dell.xml",
"driverpackcatalogoem": "https://downloads.dell.com/catalog/DriverPackCatalog.cab",
"driverpackcataloggit": "https://raw.githubusercontent.com/OSDeploy/OSDCloud/refs/heads/main/OSDCloud/catalogs/driverpack/dell.xml"
"driverpackcataloggit": "https://raw.githubusercontent.com/OSDeploy/OSDCloud/refs/heads/main/OSDCloud/core/driverpacks/dell.xml"
},
"hp": {
"driverpackcataloglocal": "catalogs\\driverpack\\hp.xml",
"driverpackcataloglocal": "core\\driverpacks\\hp.xml",
"driverpackcatalogoem": "https://hpia.hpcloud.hp.com/downloads/driverpackcatalog/HPClientDriverPackCatalog.cab",
"driverpackcataloggit": "https://raw.githubusercontent.com/OSDeploy/OSDCloud/refs/heads/main/OSDCloud/catalogs/driverpack/hp.xml"
"driverpackcataloggit": "https://raw.githubusercontent.com/OSDeploy/OSDCloud/refs/heads/main/OSDCloud/core/driverpacks/hp.xml"
},
"lenovo": {
"driverpackcataloglocal": "catalogs\\driverpack\\lenovo.xml",
"driverpackcataloglocal": "core\\driverpacks\\lenovo.xml",
"driverpackcatalogoem": "https://download.lenovo.com/cdrt/td/catalogv2.xml",
"driverpackcataloggit": "https://raw.githubusercontent.com/OSDeploy/OSDCloud/refs/heads/main/OSDCloud/catalogs/driverpack/lenovo.xml"
"driverpackcataloggit": "https://raw.githubusercontent.com/OSDeploy/OSDCloud/refs/heads/main/OSDCloud/core/driverpacks/lenovo.xml"
},
"panasonic": {
"driverpackcataloglocal": "catalogs\\driverpack\\panasonic.json",
"driverpackcataloglocal": "core\\driverpacks\\panasonic.json",
"driverpackcatalogoem": "https://pna-b2b-storage-mkt.s3.amazonaws.com/computer/software/apps/Panasonic.json",
"driverpackcataloggit": "https://raw.githubusercontent.com/OSDeploy/OSDCloud/refs/heads/main/OSDCloud/catalogs/driverpack/panasonic.json"
"driverpackcataloggit": "https://raw.githubusercontent.com/OSDeploy/OSDCloud/refs/heads/main/OSDCloud/core/driverpacks/panasonic.json"
},
"surface": {
"driverpackcataloglocal": "core\\driverpacks\\surface.json",
"driverpackcataloggit": "https://raw.githubusercontent.com/OSDeploy/OSDCloud/refs/heads/main/OSDCloud/core/driverpacks/surface.json"
},
"links": {
"david": "https://linkedin.com/in/davidsegura",
Expand Down
2 changes: 1 addition & 1 deletion OSDCloud/private/Initialize-OSDCloudDeploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function Initialize-OSDCloudDeploy {
$OSDModel = $global:OSDCloudDevice.OSDModel
$OSDProduct = $global:OSDCloudDevice.OSDProduct

$DriverPackValues = Get-DeployOSDCloudDriverPacks
$DriverPackValues = Get-CoreDriverPacks
$DriverPackObject = $DriverPackValues | Where-Object { $_.SystemId -match $OSDProduct } | Select-Object -First 1

if ($DriverPackObject) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ PSCustomObject
Array of driver pack objects containing driver information for the specified manufacturer and architecture.

.EXAMPLE
PS> Get-DeployOSDCloudDriverPacks
PS> Get-CoreDriverPacks
Returns driver packs for the current device's manufacturer and architecture.

.EXAMPLE
PS> Get-DeployOSDCloudDriverPacks -Manufacturer 'Dell' -ProcessorArchitecture 'amd64'
PS> Get-CoreDriverPacks -Manufacturer 'Dell' -ProcessorArchitecture 'amd64'
Returns driver packs for Dell devices with AMD64 architecture.

.NOTES
Requires Get-OSDCloudModulePath to be available.
Requires manufacturer-specific cmdlets (Get-OSDCloudCatalogDell, Get-OSDCloudCatalogHp, etc.) to be available.
#>
function Get-DeployOSDCloudDriverPacks {
function Get-CoreDriverPacks {
[CmdletBinding()]
param (
[System.String]
Expand All @@ -41,7 +41,7 @@ function Get-DeployOSDCloudDriverPacks {
)

# Load default catalog once
$DefaultCatalogPath = Join-Path -Path (Get-OSDCloudModulePath) -ChildPath 'catalogs\driverpack\default.json'
$DefaultCatalogPath = Join-Path (Get-OSDCloudModulePath) $OSDCloudModule.default.driverpackcataloglocal
$DefaultCatalog = Get-Content -Path $DefaultCatalogPath -Raw | ConvertFrom-Json

if ($ProcessorArchitecture -eq 'amd64') {
Expand Down
Loading