@@ -45,17 +45,17 @@ Write-Host "Copy complete!"
4545Start-Sleep - Seconds 2
4646Clear-Host
4747Write-Host " Getting image information:"
48- & ' dism' " /Get-WimInfo" " /wimfile:$mainOSDrive \tiny11\sources\install.wim"
48+ & ' dism' ' /English ' " /Get-WimInfo" " /wimfile:$mainOSDrive \tiny11\sources\install.wim"
4949$index = Read-Host " Please enter the image index"
5050Write-Host " Mounting Windows image. This may take a while."
5151$wimFilePath = " $ ( $env: SystemDrive ) \tiny11\sources\install.wim"
5252& takeown " /F" $wimFilePath
5353& icacls $wimFilePath " /grant" " Administrators:(F)"
5454Set-ItemProperty - Path $wimFilePath - Name IsReadOnly - Value $false
5555New-Item - ItemType Directory - Force - Path " $mainOSDrive \scratchdir"
56- & dism " /mount-image" " /imagefile:$ ( $env: SystemDrive ) \tiny11\sources\install.wim" " /index:$index " " /mountdir:$ ( $env: SystemDrive ) \scratchdir"
56+ & dism / English " /mount-image" " /imagefile:$ ( $env: SystemDrive ) \tiny11\sources\install.wim" " /index:$index " " /mountdir:$ ( $env: SystemDrive ) \scratchdir"
5757
58- $imageIntl = & dism / Get-Intl " /Image:$ ( $env: SystemDrive ) \scratchdir"
58+ $imageIntl = & dism / English / Get-Intl " /Image:$ ( $env: SystemDrive ) \scratchdir"
5959$languageLine = $imageIntl -split ' \n' | Where-Object { $_ -match ' Default system UI language : ([a-zA-Z]{2}-[a-zA-Z]{2})' }
6060
6161if ($languageLine ) {
@@ -65,7 +65,7 @@ if ($languageLine) {
6565 Write-Host " Default system UI language code not found."
6666}
6767
68- $imageInfo = & ' dism' ' /Get-WimInfo' " /wimFile:$ ( $env: SystemDrive ) \tiny11\sources\install.wim" " /index:$index "
68+ $imageInfo = & ' dism' ' /English ' ' / Get-WimInfo' " /wimFile:$ ( $env: SystemDrive ) \tiny11\sources\install.wim" " /index:$index "
6969$lines = $imageInfo -split ' \r?\n'
7070
7171foreach ($line in $lines ) {
@@ -87,7 +87,7 @@ if (-not $architecture) {
8787
8888Write-Host " Mounting complete! Performing removal of applications..."
8989
90- $packages = & ' dism' " /image:$ ( $env: SystemDrive ) \scratchdir" ' /Get-ProvisionedAppxPackages' |
90+ $packages = & ' dism' ' /English ' " /image:$ ( $env: SystemDrive ) \scratchdir" ' /Get-ProvisionedAppxPackages' |
9191 ForEach-Object {
9292 if ($_ -match ' PackageName : (.*)' ) {
9393 $matches [1 ]
@@ -100,7 +100,7 @@ $packagesToRemove = $packages | Where-Object {
100100 $packagePrefixes -contains ($packagePrefixes | Where-Object { $packageName -like " $_ *" })
101101}
102102foreach ($package in $packagesToRemove ) {
103- & ' dism' " /image:$ ( $env: SystemDrive ) \scratchdir" ' /Remove-ProvisionedAppxPackage' " /PackageName:$package "
103+ & ' dism' ' /English ' " /image:$ ( $env: SystemDrive ) \scratchdir" ' /Remove-ProvisionedAppxPackage' " /PackageName:$package "
104104}
105105
106106
@@ -208,12 +208,12 @@ reg unload HKLM\zSCHEMA
208208reg unload HKLM\zSOFTWARE
209209reg unload HKLM\zSYSTEM
210210Write-Host " Cleaning up image..."
211- & ' dism' " /image:$mainOSDrive \scratchdir" ' /Cleanup-Image' ' /StartComponentCleanup' ' /ResetBase'
211+ & ' dism' ' /English ' " /image:$mainOSDrive \scratchdir" ' /Cleanup-Image' ' /StartComponentCleanup' ' /ResetBase'
212212Write-Host " Cleanup complete."
213213Write-Host " Unmounting image..."
214- & ' dism' ' /unmount-image' " /mountdir:$mainOSDrive \scratchdir" ' /commit'
214+ & ' dism' ' /English ' ' / unmount-image' " /mountdir:$mainOSDrive \scratchdir" ' /commit'
215215Write-Host " Exporting image..."
216- & ' Dism ' ' /Export-Image' " /SourceImageFile:$mainOSDrive \tiny11\sources\install.wim" " /SourceIndex:$index " " /DestinationImageFile:$mainOSDrive \tiny11\sources\install2.wim" ' /compress:max'
216+ & ' dism ' ' /English ' ' /Export-Image' " /SourceImageFile:$mainOSDrive \tiny11\sources\install.wim" " /SourceIndex:$index " " /DestinationImageFile:$mainOSDrive \tiny11\sources\install2.wim" ' /compress:max'
217217Remove-Item - Path " $mainOSDrive \tiny11\sources\install.wim" - Force
218218Rename-Item - Path " $mainOSDrive \tiny11\sources\install2.wim" - NewName " install.wim"
219219Write-Host " Windows image completed. Continuing with boot.wim."
@@ -224,7 +224,7 @@ $wimFilePath = "$($env:SystemDrive)\tiny11\sources\boot.wim"
224224& takeown " /F" $wimFilePath
225225& icacls $wimFilePath " /grant" " Administrators:(F)"
226226Set-ItemProperty - Path $wimFilePath - Name IsReadOnly - Value $false
227- & ' dism' ' /mount-image' " /imagefile:$mainOSDrive \tiny11\sources\boot.wim" ' /index:2' " /mountdir:$mainOSDrive \scratchdir"
227+ & ' dism' ' /English ' ' / mount-image' " /imagefile:$mainOSDrive \tiny11\sources\boot.wim" ' /index:2' " /mountdir:$mainOSDrive \scratchdir"
228228Write-Host " Loading registry..."
229229reg load HKLM\zCOMPONENTS $mainOSDrive \scratchdir\Windows\System32\config\COMPONENTS
230230reg load HKLM\zDEFAULT $mainOSDrive \scratchdir\Windows\System32\config\default
@@ -252,7 +252,7 @@ reg unload HKLM\zSCHEMA
252252reg unload HKLM\zSOFTWARE
253253reg unload HKLM\zSYSTEM
254254Write-Host " Unmounting image..."
255- & ' dism' ' /unmount-image' " /mountdir:$mainOSDrive \scratchdir" ' /commit'
255+ & ' dism' ' /English ' ' / unmount-image' " /mountdir:$mainOSDrive \scratchdir" ' /commit'
256256Clear-Host
257257Write-Host " The tiny11 image is now completed. Proceeding with the making of the ISO..."
258258Write-Host " Copying unattended file for bypassing MS account on OOBE..."
0 commit comments