OSD icon indicating copy to clipboard operation
OSD copied to clipboard

Type mismatch in Save-WebFile.ps1

Open astavitsky opened this issue 2 months ago • 5 comments

Describe the bug Downloading driver packs whether for WinPE or offline USB produces the error:

InvalidOperation: C:\Program Files\PowerShell\Modules\OSD\25.10.22.2\Public\Functions\Other\Save-WebFile.ps1:145
Line |
 145 |                  $localExists `
     |                  ~~~~~~~~~~~~~~
     | Could not compare "978731008" to "978731008". Error: "Cannot convert the "System.String[]" value of type
     | "System.String[]" to type "System.Int64"."
InvalidOperation: C:\Program Files\PowerShell\Modules\OSD\25.10.22.2\Public\Functions\Other\Save-WebFile.ps1:165
Line |
 165 |  …         if ($localExists -and ((Get-Item $DestinationFullName).Length …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Could not compare "978731008" to "978731008". Error: "Cannot convert the "System.String[]" value of type
     | "System.String[]" to type "System.Int64"."

It appears that the driver packs were downloaded successfully despite the error above.

To Reproduce Update-OSDCloud -DriverPack Microsoft

Expected behavior No errors are produced

Screenshots N/A

Desktop (please complete the following information):

  • OS: Windows 11 24H2
  • Browser [e.g. chrome, safari]

astavitsky avatar Oct 22 '25 23:10 astavitsky

Does this happen using PowerShell 7 or Windows PowerShell? (5.1)

everydayintech avatar Oct 27 '25 07:10 everydayintech

I'm getting the same error with driver and os downloads, seems to download fine. I'm on Powershell 7

ITaanspreekpunt avatar Oct 27 '25 12:10 ITaanspreekpunt

@OSDeploy this issue is fixed in #326

Image

everydayintech avatar Oct 28 '25 09:10 everydayintech

This issue should be resolved as #326 was merged by @OSDeploy

@astavitsky can you verify on your end?

everydayintech avatar Nov 11 '25 09:11 everydayintech

Confirmed working.

astavitsky avatar Nov 15 '25 19:11 astavitsky