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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@ All notable changes to this project will be documented in this file.
- Made bundled operating-system catalogs win when an external catalog has the same build revision, while preserving higher-revision external overlays.
- Merged the OSD and OSDCloud catalog projections into `Get-OSDCoreOperatingSystems`, retaining each module's native property schema.
- Updated deployment initialization, operating-system selection, default OS resolution, catalog refresh, maintenance guidance, and function help to use the unified provider and synchronized catalog model.
- Unified the shared private core utilities with OSD and renamed the centralized download helper to `Invoke-RecastOSDDownloadFile`.

### Fixed

- Made HP driver pack catalog release-date parsing culture-independent.
- Corrected the shared download helper's forced WebClient path so it no longer overwrites the typed switch parameter.

### Removed

- Removed the redundant private `Get-OSDCloudCoreOperatingSystems` provider after migrating its callers to the unified function.
- Removed the legacy `Invoke-OSDCloudDownloadFile` command name.

## 26.9.29.1 - September 29, 2026

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ function Update-RecastOSDCloudUSBCache {
(New-Object System.Management.Automation.Host.ChoiceDescription '&No', 'Skip the OperatingSystem download.')
)
if ($downloadOperatingSystem -and ($host.UI.PromptForChoice($caption, $message, $choices, 1) -eq 0)) {
$savedOperatingSystem = Invoke-OSDCoreDownloadFile -SourceUrl $selectedOperatingSystemUrl -DestinationDirectory $osdCoreOperatingSystemDestination -DestinationName $global:OSDCoreOperatingSystemCloudObject.FileName -ErrorAction Stop
$savedOperatingSystem = Invoke-RecastOSDDownloadFile -SourceUrl $selectedOperatingSystemUrl -DestinationDirectory $osdCoreOperatingSystemDestination -DestinationName $global:OSDCoreOperatingSystemCloudObject.FileName -ErrorAction Stop

# Verify the downloaded payload before refreshing the cache inventory.
if (-not [string]::IsNullOrWhiteSpace($expectedOperatingSystemHash)) {
Expand Down Expand Up @@ -434,7 +434,7 @@ function Update-RecastOSDCloudUSBCache {
(New-Object System.Management.Automation.Host.ChoiceDescription '&No', 'Skip the driver pack download.')
)
if ($downloadDriverPack -and ($host.UI.PromptForChoice($caption, $message, $choices, 1) -eq 0)) {
$savedDriverPack = Invoke-OSDCoreDownloadFile -SourceUrl $global:OSDCoreDriverPackCloudObject.Url -DestinationDirectory $osdCoreDriverPackDestination -DestinationName $global:OSDCoreDriverPackCloudObject.FileName -ErrorAction Stop
$savedDriverPack = Invoke-RecastOSDDownloadFile -SourceUrl $global:OSDCoreDriverPackCloudObject.Url -DestinationDirectory $osdCoreDriverPackDestination -DestinationName $global:OSDCoreDriverPackCloudObject.FileName -ErrorAction Stop

# Verify the downloaded driver pack before refreshing the cache inventory.
if (-not [string]::IsNullOrWhiteSpace($expectedDriverPackHashMD5)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
<#
.SYNOPSIS
Downloads a file from the internet and returns a Get-Item Object
.DESCRIPTION
Downloads a file from the internet and returns a Get-Item Object
.LINK
https://github.com/OSDeploy/OSD/tree/master/Docs
#>
function Invoke-OSDCloudDownloadFile {
function Invoke-RecastOSDDownloadFile {
<#
.SYNOPSIS
Downloads a file to a local path and returns file information.

.DESCRIPTION
Downloads content from a source URL into a destination directory using
either curl or WebClient fallback logic, then returns a FileInfo object for
the downloaded file.

.PARAMETER SourceUrl
Source URL to download.

.PARAMETER DestinationName
Optional destination file name. If omitted, the file name is derived from
the source URL.

.PARAMETER DestinationDirectory
Destination directory for the downloaded file.

.PARAMETER Overwrite
Overwrites the destination file if it already exists.

.PARAMETER WebClient
Forces use of WebClient instead of curl.

.EXAMPLE
Invoke-RecastOSDDownloadFile -SourceUrl 'https://example.org/file.cab' -DestinationDirectory "$env:TEMP\OSD"
Downloads the file and returns a FileInfo object.

.LINK
https://github.com/OSDeploy/OSD/tree/master/docs

.NOTES
Author: David Segura - Recast Software
2026-09-30 - Unified the OSD and OSDCloud download helpers
#>
[CmdletBinding()]
[OutputType([System.IO.FileInfo])]
param
Expand All @@ -33,6 +61,7 @@ function Invoke-OSDCloudDownloadFile {
[System.Management.Automation.SwitchParameter]
$WebClient
)
$Error.Clear()
#=================================================
# Values
#=================================================
Expand Down Expand Up @@ -108,9 +137,13 @@ function Invoke-OSDCloudDownloadFile {

if ($UseWebClient -eq $true) {
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls1
$WebClient = New-Object System.Net.WebClient
$WebClient.DownloadFile($SourceUrl, $DestinationFullName)
$WebClient.Dispose()
$webClientInstance = New-Object System.Net.WebClient
try {
$webClientInstance.DownloadFile($SourceUrl, $DestinationFullName)
}
finally {
$webClientInstance.Dispose()
}
}
else {
Write-Verbose "[$(Get-Date -format s)] [$($MyInvocation.MyCommand.Name)] cURL Source: $SourceUrl"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function step-install-downloadwindowsimage {
$null = New-Item -Path $USBDownloadPath -ItemType Directory -Force
}
Write-Verbose -Message "[$(Get-Date -format s)] [$($MyInvocation.MyCommand.Name)] Downloading Windows image to USB cache."
$SaveWebFile = Invoke-OSDCloudDownloadFile -SourceUrl $OperatingSystemFilePath -DestinationDirectory "$USBDownloadPath" -DestinationName $FileName
$SaveWebFile = Invoke-RecastOSDDownloadFile -SourceUrl $OperatingSystemFilePath -DestinationDirectory "$USBDownloadPath" -DestinationName $FileName

if ($SaveWebFile) {
Write-Verbose -Message "[$(Get-Date -format s)] [$($MyInvocation.MyCommand.Name)] Copying cached Windows image from $($SaveWebFile.FullName) to $DownloadPath."
Expand All @@ -135,7 +135,7 @@ function step-install-downloadwindowsimage {
# $SaveWebFile is a FileInfo Object, not a path
Write-Host -ForegroundColor DarkGray "[$(Get-Date -format s)] [INFO] DownloadPath: $DownloadPath"
Write-Verbose -Message "[$(Get-Date -format s)] [$($MyInvocation.MyCommand.Name)] Downloading Windows image directly to $DownloadPath."
$SaveWebFile = Invoke-OSDCloudDownloadFile -SourceUrl $OperatingSystemFilePath -DestinationDirectory $DownloadPath -ErrorAction Stop
$SaveWebFile = Invoke-RecastOSDDownloadFile -SourceUrl $OperatingSystemFilePath -DestinationDirectory $DownloadPath -ErrorAction Stop
$FileInfo = $SaveWebFile
}
#=================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function step-Save-WindowsDriver-DriverPack {
}
Write-Verbose -Message "[$(Get-Date -format s)] [$($MyInvocation.MyCommand.Name)] Downloading DriverPack to USB cache."
Write-Host -ForegroundColor DarkGray "[$(Get-Date -format s)] [PROGRESS] Downloading or reusing the driver pack in the USB cache."
$SaveWebFile = Invoke-OSDCloudDownloadFile -SourceUrl $DriverPackCloudObject.Url -DestinationDirectory $USBDownloadPath -DestinationName $FileName -ErrorAction Stop
$SaveWebFile = Invoke-RecastOSDDownloadFile -SourceUrl $DriverPackCloudObject.Url -DestinationDirectory $USBDownloadPath -DestinationName $FileName -ErrorAction Stop
if ($SaveWebFile) {
Write-Verbose -Message "[$(Get-Date -format s)] [$($MyInvocation.MyCommand.Name)] Copying cached DriverPack from $($SaveWebFile.FullName) to $DownloadPath."
Write-Host -ForegroundColor DarkGray "[$(Get-Date -format s)] [PROGRESS] Copying cached driver pack from:"
Expand All @@ -223,7 +223,7 @@ function step-Save-WindowsDriver-DriverPack {
$ProgressPhase = "Downloading driver pack to $DownloadPath"
Write-Host -ForegroundColor DarkGray "[$(Get-Date -format s)] [PROGRESS] USB cache did not provide a usable file. Downloading directly to:"
Write-Host -ForegroundColor DarkGray " $DownloadPath"
$SaveWebFile = Invoke-OSDCloudDownloadFile -SourceUrl $DriverPackCloudObject.Url -DestinationDirectory $DownloadPath -DestinationName $FileName -ErrorAction Stop
$SaveWebFile = Invoke-RecastOSDDownloadFile -SourceUrl $DriverPackCloudObject.Url -DestinationDirectory $DownloadPath -DestinationName $FileName -ErrorAction Stop
$FileInfo = $SaveWebFile
}
}
Expand All @@ -235,7 +235,7 @@ function step-Save-WindowsDriver-DriverPack {
Write-Host -ForegroundColor DarkGray "[$(Get-Date -format s)] [PROGRESS] Downloading driver pack directly to:"
Write-Host -ForegroundColor DarkGray " $DownloadPath"
Write-Verbose -Message "[$(Get-Date -format s)] [$($MyInvocation.MyCommand.Name)] Downloading DriverPack directly to $DownloadPath."
$SaveWebFile = Invoke-OSDCloudDownloadFile -SourceUrl $DriverPackCloudObject.Url -DestinationDirectory $DownloadPath -ErrorAction Stop
$SaveWebFile = Invoke-RecastOSDDownloadFile -SourceUrl $DriverPackCloudObject.Url -DestinationDirectory $DownloadPath -ErrorAction Stop
$FileInfo = $SaveWebFile
}
#=================================================
Expand Down
Loading