Window11 Automatic Silent Installation

I need help with the following script, which I need to run remotely. The script downloads the Windows 11 installation executable from the Microsoft website to upgrade a system from Windows 10 to Windows 11. I tested it locally on a Windows 10 workstation, but the issue is that the process doesn’t progress—it just gets stuck in Task Manager. I’m not sure what I might be missing, and I would really appreciate your assistance.

Set-ExecutionPolicy Bypass -Scope Process -Force

Define the upgrade folder

$FolderPath = “C:\WindowsUpgrade”

Create the folder if it does not exist

if (!(Test-Path -Path $FolderPath)) {
Write-Host “Creating Windows Upgrade Folder…”
New-Item -Path $FolderPath -ItemType Directory
}

Define the URL and download location

$DownloadUrl = “LinkedIn
$InstallerPath = “$FolderPath\Windows11InstallationAssistant.exe”

Download the installer

Write-Host “Downloading Windows 11 Installation Assistant…”
Invoke-WebRequest -Uri $DownloadUrl -OutFile $InstallerPath

Check if the download was successful

if (Test-Path $InstallerPath) {
Write-Host “Download complete. Running installer…”
Start-Process -FilePath $InstallerPath -ArgumentList “/auto upgrade /quiet /noreboot /Compat IgnoreWarning” -Verb RunAs -Wait -NoNewWindow
Write-Host “Installation process has started.”
} else {
Write-Host “Download failed. Please check your internet connection and try again.”
}

The first internet result for this was for a Powershell script that someone wrote that does actually this. A quick glance at the script would suggest your issue isn’t Powershell related, but rather you are missing required switches for the installation assistant.

Hi @qmaster7953,

Welcome to the forums first and foremost!

When working with code, please be sure to follow this formatting to ensure all code is captured and nothing is left off:

For easy visibility, you can simply put 3 ` surrounding the code.

2 Likes

Hi qmaster,

Start-Process has two parameter sets and your using a parameter -verb which is only in one parameter set.

Please review your parameters used with start-process and try again.

Start-Process Parameter Set #1

Start-Process
     [-FilePath] <string>
     [[-ArgumentList] <string[]>]
     [-Credential <pscredential>]
     [-WorkingDirectory <string>]
     [-LoadUserProfile]
     [-NoNewWindow]
     [-PassThru]
     [-RedirectStandardError <string>]
     [-RedirectStandardInput <string>]
     [-RedirectStandardOutput <string>]
     [-WindowStyle <ProcessWindowStyle>]
     [-Wait]
     [-UseNewEnvironment]
     [-Environment <hashtable>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]

Start-Process Parameter Set #2

Start-Process
     [-FilePath] <string>
     [[-ArgumentList] <string[]>]
     [-WorkingDirectory <string>]
     [-PassThru]
     [-Verb <string>]
     [-WindowStyle <ProcessWindowStyle>]
     [-Wait]
     [-Environment <hashtable>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
1 Like

Good morning :folded_hands: thank you so much guys i ended up getting right :white_check_mark: :blush:

@qmaster7953

You marked my deleted Post as solution. Could fix that, please.

Thanks in advance.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.