mirror of
https://github.com/MicrosoftDocs/windows-itpro-docs.git
synced 2025-05-12 21:37:22 +00:00
Update media-dynamic-update.md
Replace curly quotes with straight quotes.
This commit is contained in:
parent
7de52044c7
commit
b9a4fb23df
@ -121,19 +121,19 @@ $LANG = "ja-jp"
|
||||
$LANG_FONT_CAPABILITY = "jpan"
|
||||
|
||||
# Declare Dynamic Update packages
|
||||
$LCU_PATH = “C:\mediaRefresh\packages\LCU.msu”
|
||||
$SSU_PATH = “C:\mediaRefresh\packages\SSU_DU.msu”
|
||||
$LCU_PATH = "C:\mediaRefresh\packages\LCU.msu"
|
||||
$SSU_PATH = "C:\mediaRefresh\packages\SSU_DU.msu"
|
||||
$SETUP_DU_PATH = "C:\mediaRefresh\packages\Setup_DU.cab"
|
||||
$SAFE_OS_DU_PATH = “C:\mediaRefresh\packages\SafeOS_DU.cab”
|
||||
$DOTNET_CU_PATH = "C:\mediaRefresh\packages\DotNet_CU.msu”
|
||||
$SAFE_OS_DU_PATH = "C:\mediaRefresh\packages\SafeOS_DU.cab"
|
||||
$DOTNET_CU_PATH = "C:\mediaRefresh\packages\DotNet_CU.msu"
|
||||
|
||||
# Declare folders for mounted images and temp files
|
||||
$WORKING_PATH = "C:\mediaRefresh\temp"
|
||||
$MEDIA_OLD_PATH = "C:\mediaRefresh\oldMedia"
|
||||
$MEDIA_NEW_PATH = "C:\mediaRefresh\newMedia"
|
||||
$MAIN_OS_MOUNT = $WORKING_PATH + "\MainOSMount”
|
||||
$WINRE_MOUNT = $WORKING_PATH + "\WinREMount”
|
||||
$WINPE_MOUNT = $WORKING_PATH + "\WinPEMount”
|
||||
$MAIN_OS_MOUNT = $WORKING_PATH + "\MainOSMount"
|
||||
$WINRE_MOUNT = $WORKING_PATH + "\WinREMount"
|
||||
$WINPE_MOUNT = $WORKING_PATH + "\WinPEMount"
|
||||
|
||||
# Mount the language pack ISO
|
||||
Write-Host "$(Get-TS): Mounting LP ISO"
|
||||
@ -162,7 +162,7 @@ New-Item -ItemType directory -Path $WINPE_MOUNT -ErrorAction stop | Out-Null
|
||||
|
||||
# Keep the original media, make a copy of it for the new, updateed media.
|
||||
Write-Host "$(Get-TS): Copying original media to new media path"
|
||||
Copy-Item -Path $MEDIA_OLD_PATH“\*” -Destination $MEDIA_NEW_PATH -Force -Recurse -ErrorAction stop | Out-Null
|
||||
Copy-Item -Path $MEDIA_OLD_PATH"\*" -Destination $MEDIA_NEW_PATH -Force -Recurse -ErrorAction stop | Out-Null
|
||||
Get-ChildItem -Path $MEDIA_NEW_PATH -Recurse | Where-Object { -not $_.PSIsContainer -and $_.IsReadOnly } | ForEach-Object { $_.IsReadOnly = $false }
|
||||
```
|
||||
### Update WinRE
|
||||
@ -177,14 +177,14 @@ It finishes by cleaning and exporting the image to reduce the image size.
|
||||
```
|
||||
# Mount the main operating system, used throughout the script
|
||||
Write-Host "$(Get-TS): Mounting main OS"
|
||||
Mount-WindowsImage -ImagePath $MEDIA_NEW_PATH"\sources\install.wim” -Index 1 -Path $MAIN_OS_MOUNT -ErrorAction stop| Out-Null
|
||||
Mount-WindowsImage -ImagePath $MEDIA_NEW_PATH"\sources\install.wim" -Index 1 -Path $MAIN_OS_MOUNT -ErrorAction stop| Out-Null
|
||||
|
||||
#
|
||||
# update Windows Recovery Environment (WinRE)
|
||||
#
|
||||
Copy-Item -Path $MAIN_OS_MOUNT"\windows\system32\recovery\winre.wim” -Destination $WORKING_PATH"\winre.wim” -Force -Recurse -ErrorAction stop | Out-Null
|
||||
Copy-Item -Path $MAIN_OS_MOUNT"\windows\system32\recovery\winre.wim" -Destination $WORKING_PATH"\winre.wim" -Force -Recurse -ErrorAction stop | Out-Null
|
||||
Write-Host "$(Get-TS): Mounting WinRE"
|
||||
Mount-WindowsImage -ImagePath $WORKING_PATH"\winre.wim” -Index 1 -Path $WINRE_MOUNT -ErrorAction stop | Out-Null
|
||||
Mount-WindowsImage -ImagePath $WORKING_PATH"\winre.wim" -Index 1 -Path $WINRE_MOUNT -ErrorAction stop | Out-Null
|
||||
|
||||
# Add servicing stack update
|
||||
Write-Host "$(Get-TS): Adding package $SSU_PATH"
|
||||
@ -247,9 +247,9 @@ DISM /image:$WINRE_MOUNT /cleanup-image /StartComponentCleanup | Out-Null
|
||||
Dismount-WindowsImage -Path $WINRE_MOUNT -Save -ErrorAction stop | Out-Null
|
||||
|
||||
# Export
|
||||
Write-Host "$(Get-TS): Exporting image to $WORKING_PATH\winre2.wim”
|
||||
Export-WindowsImage -SourceImagePath $WORKING_PATH"\winre.wim” -SourceIndex 1 -DestinationImagePath $WORKING_PATH"\winre2.wim” -ErrorAction stop | Out-Null
|
||||
Move-Item -Path $WORKING_PATH"\winre2.wim” -Destination $WORKING_PATH"\winre.wim” -Force -ErrorAction stop | Out-Null
|
||||
Write-Host "$(Get-TS): Exporting image to $WORKING_PATH\winre2.wim"
|
||||
Export-WindowsImage -SourceImagePath $WORKING_PATH"\winre.wim" -SourceIndex 1 -DestinationImagePath $WORKING_PATH"\winre2.wim" -ErrorAction stop | Out-Null
|
||||
Move-Item -Path $WORKING_PATH"\winre2.wim" -Destination $WORKING_PATH"\winre.wim" -Force -ErrorAction stop | Out-Null
|
||||
```
|
||||
### Update WinPE
|
||||
|
||||
@ -261,13 +261,13 @@ This script is similar to the one that updates WinRE, but instead it mounts Boot
|
||||
#
|
||||
|
||||
# Get the list of images contained within WinPE
|
||||
$WINPE_IMAGES = Get-WindowsImage -ImagePath $MEDIA_NEW_PATH“\sources\boot.wim”
|
||||
$WINPE_IMAGES = Get-WindowsImage -ImagePath $MEDIA_NEW_PATH"\sources\boot.wim"
|
||||
|
||||
Foreach ($IMAGE in $WINPE_IMAGES) {
|
||||
|
||||
# update WinPE
|
||||
Write-Host "$(Get-TS): Mounting WinPE"
|
||||
Mount-WindowsImage -ImagePath $MEDIA_NEW_PATH“\sources\boot.wim” -Index $IMAGE.ImageIndex -Path $WINPE_MOUNT -ErrorAction stop | Out-Null
|
||||
Mount-WindowsImage -ImagePath $MEDIA_NEW_PATH"\sources\boot.wim" -Index $IMAGE.ImageIndex -Path $WINPE_MOUNT -ErrorAction stop | Out-Null
|
||||
|
||||
# Add SSU
|
||||
Write-Host "$(Get-TS): Adding package $SSU_PATH"
|
||||
@ -334,12 +334,12 @@ Foreach ($IMAGE in $WINPE_IMAGES) {
|
||||
Dismount-WindowsImage -Path $WINPE_MOUNT -Save -ErrorAction stop | Out-Null
|
||||
|
||||
#Export WinPE
|
||||
Write-Host "$(Get-TS): Exporting image to $WORKING_PATH\boot2.wim”
|
||||
Export-WindowsImage -SourceImagePath $MEDIA_NEW_PATH“\sources\boot.wim” -SourceIndex $IMAGE.ImageIndex -DestinationImagePath $WORKING_PATH"\boot2.wim" -ErrorAction stop | Out-Null
|
||||
Write-Host "$(Get-TS): Exporting image to $WORKING_PATH\boot2.wim"
|
||||
Export-WindowsImage -SourceImagePath $MEDIA_NEW_PATH"\sources\boot.wim" -SourceIndex $IMAGE.ImageIndex -DestinationImagePath $WORKING_PATH"\boot2.wim" -ErrorAction stop | Out-Null
|
||||
|
||||
}
|
||||
|
||||
Move-Item -Path $WORKING_PATH"\boot2.wim" -Destination $MEDIA_NEW_PATH“\sources\boot.wim” -Force -ErrorAction stop | Out-Null
|
||||
Move-Item -Path $WORKING_PATH"\boot2.wim" -Destination $MEDIA_NEW_PATH"\sources\boot.wim" -Force -ErrorAction stop | Out-Null
|
||||
```
|
||||
### Update the main operating system
|
||||
|
||||
@ -390,7 +390,7 @@ Add-WindowsPackage -Path $MAIN_OS_MOUNT -PackagePath $LCU_PATH -ErrorAction stop
|
||||
# Copy our updated recovery image from earlier into the main OS
|
||||
# Note: If I were updating more than 1 edition, I'd want to copy the same recovery image file
|
||||
# into each edition to enable single instancing
|
||||
Copy-Item -Path $WORKING_PATH"\winre.wim” -Destination $MAIN_OS_MOUNT"\windows\system32\recovery\winre.wim” -Force -Recurse -ErrorAction stop | Out-Null
|
||||
Copy-Item -Path $WORKING_PATH"\winre.wim" -Destination $MAIN_OS_MOUNT"\windows\system32\recovery\winre.wim" -Force -Recurse -ErrorAction stop | Out-Null
|
||||
|
||||
# Perform image cleanup
|
||||
Write-Host "$(Get-TS): Performing image cleanup on main OS"
|
||||
@ -413,9 +413,9 @@ Add-WindowsPackage -Path $MAIN_OS_MOUNT -PackagePath $DOTNET_CU_PATH -ErrorActio
|
||||
Dismount-WindowsImage -Path $MAIN_OS_MOUNT -Save -ErrorAction stop | Out-Null
|
||||
|
||||
# Export
|
||||
Write-Host "$(Get-TS): Exporting image to $WORKING_PATH\install2.wim”
|
||||
Export-WindowsImage -SourceImagePath $MEDIA_NEW_PATH“\sources\install.wim” -SourceIndex 1 -DestinationImagePath $WORKING_PATH"\install2.wim” -ErrorAction stop | Out-Null
|
||||
Move-Item -Path $WORKING_PATH"\install2.wim” -Destination $MEDIA_NEW_PATH“\sources\install.wim” -Force -ErrorAction stop | Out-Null
|
||||
Write-Host "$(Get-TS): Exporting image to $WORKING_PATH\install2.wim"
|
||||
Export-WindowsImage -SourceImagePath $MEDIA_NEW_PATH"\sources\install.wim" -SourceIndex 1 -DestinationImagePath $WORKING_PATH"\install2.wim" -ErrorAction stop | Out-Null
|
||||
Move-Item -Path $WORKING_PATH"\install2.wim" -Destination $MEDIA_NEW_PATH"\sources\install.wim" -Force -ErrorAction stop | Out-Null
|
||||
```
|
||||
|
||||
### Update remaining media files
|
||||
@ -450,4 +450,3 @@ Dismount-DiskImage -ImagePath $FOD_ISO_PATH -ErrorAction stop | Out-Null
|
||||
|
||||
Write-Host "$(Get-TS): Media refresh completed!"
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user