Skip to content
Merged
Changes from 1 commit
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
9 changes: 8 additions & 1 deletion functions/private/Invoke-WinUtilISO.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -551,15 +551,22 @@ function Invoke-WinUtilISOExport {

$outputISO = $dlg.FileName

# Locate oscdimg.exe (Windows ADK or winget per-user install)
# Windows ADK installation
$oscdimg = Get-ChildItem "C:\Program Files (x86)\Windows Kits" -Recurse -Filter "oscdimg.exe" |
Select-Object -First 1 -ExpandProperty FullName
if (-not $oscdimg) {
# Per-user winget installation
$oscdimg = Get-ChildItem "$env:LOCALAPPDATA\Microsoft\WinGet\Packages" -Recurse -Filter "oscdimg.exe" |
Where-Object { $_.FullName -match 'Microsoft\.OSCDIMG' } |
Select-Object -First 1 -ExpandProperty FullName
}

if (-not $oscdimg) {
# Installation available through PATH, including machine-wide winget links
$oscdimg = Get-Command oscdimg.exe -CommandType Application -ErrorAction SilentlyContinue |
Select-Object -First 1 -ExpandProperty Source
}

Comment thread
mewclouds marked this conversation as resolved.
Outdated
if (-not $oscdimg) {
Write-WinUtilISOLog "oscdimg.exe not found. Attempting to install via winget..."
try {
Expand Down