mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-05-10 00:02:09 +00:00
Add quotes to DISM file paths
Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>
This commit is contained in:
parent
34e0988cd4
commit
6fa9d3cdd3
@ -65,11 +65,11 @@ public class PowerManagement {
|
||||
Write-Host "Exporting Windows image to a WIM file, keeping the index we want to work on. This can take several minutes, depending on the performance of your computer..."
|
||||
try {
|
||||
# Try ps command first
|
||||
Export-WindowsImage -SourceImagePath $mountDir\sources\install.esd -SourceIndex $index -DestinationImagePath $mountDir\sources\install.wim -CompressionType "Max"
|
||||
Export-WindowsImage -SourceImagePath "$mountDir\sources\install.esd" -SourceIndex $index -DestinationImagePath "$mountDir\sources\install.wim" -CompressionType "Max"
|
||||
} catch {
|
||||
# Fallback to DISM command
|
||||
Write-Host "Export-WindowsImage failed, using DISM instead..."
|
||||
dism /Export-Image /SourceImageFile:$mountDir\sources\install.esd /SourceIndex:$index /DestinationImageFile:$mountDir\sources\install.wim /Compress:max
|
||||
dism /Export-Image /SourceImageFile:"$mountDir\sources\install.esd" /SourceIndex:$index /DestinationImageFile:"$mountDir\sources\install.wim" /Compress:max
|
||||
}
|
||||
if ($?) {
|
||||
Remove-Item -Path "$mountDir\sources\install.esd" -Force
|
||||
|
Loading…
Reference in New Issue
Block a user