Skip to content
Merged
Changes from all commits
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
28 changes: 23 additions & 5 deletions azure-local/upgrade/upgrade-22h2-to-23h2-powershell.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Upgrade Azure Stack HCI OS, version 22H2 to version 23H2 via PowerShell
description: Learn how to use PowerShell to upgrade Azure Stack HCI OS, version 22H2 to version 23H2.
author: alkohli
ms.topic: how-to
ms.date: 10/08/2025
ms.date: 12/02/2025
ms.author: alkohli
ms.reviewer: alkohli
ms.service: azure-local
Expand Down Expand Up @@ -293,6 +293,24 @@ To install the new OS using PowerShell, follow these steps:
Test-Cluster
```

1. Extract the contents of the ISO image and copy them to the local system drive on each machine. Ensure that the local path is the same on each machine. Then, update the `PathToSetupMedia` parameter with the local path to the extracted ISO contents, not the ISO file.

```powershell
# Define ISO and destination folder for extracted contents
$isoFilePath = "C:\SetupFiles\WindowsServer\ISOs\example.iso"
$destinationPath = "C:\SetupFiles\WindowsServer\ExtractedFilesFolder"
# Mount the ISO file
$iso = Mount-DiskImage -ImagePath $isoFilePath
# Get the drive letter
$driveLetter = ($iso | Get-Volume).DriveLetter
# Create the destination directory
New-Item -ItemType Directory -Path $destinationPath
# Copy contents to the local directory
Copy-Item -Path "${driveLetter}:\*" -Destination $destinationPath -Recurse
# Dismount the ISO file
Dismount-DiskImage -ImagePath $isoFilePath
```

1. Check for the available updates:

```PowerShell
Expand Down Expand Up @@ -348,20 +366,20 @@ To install the new OS using PowerShell, follow these steps:
Test-Cluster
```

1. Extract the contents of the ISO image and copy them to the local system drive on each machine. Ensure that the local path is the same on each machine. Then, update the `PathToSetupMedia` parameter with the local path to the ISO image.
1. Extract the contents of the ISO image and copy them to the local system drive on each machine. Ensure that the local path is the same on each machine. Then, update the `PathToSetupMedia` parameter with the local path to the extracted ISO contents, not the ISO file.

```powershell
# Define ISO and destination paths
# Define ISO and destination folder for extracted contents
$isoFilePath = "C:\SetupFiles\WindowsServer\ISOs\example.iso"
$destinationPath = "C:\SetupFiles\WindowsServer\Files"
$destinationPath = "C:\SetupFiles\WindowsServer\ExtractedFilesFolder"
# Mount the ISO file
$iso = Mount-DiskImage -ImagePath $isoFilePath
# Get the drive letter
$driveLetter = ($iso | Get-Volume).DriveLetter
# Create the destination directory
New-Item -ItemType Directory -Path $destinationPath
# Copy contents to the local directory
Copy-Item -Path "${driveLetter}:\*" -Destination $destinationPath Recurse
Copy-Item -Path "${driveLetter}:\*" -Destination $destinationPath -Recurse
# Dismount the ISO file
Dismount-DiskImage -ImagePath $isoFilePath
```
Expand Down