$ProgressPreference = 'SilentlyContinue' $chromeMsiPath = "$env:TEMP\googlechromestandaloneenterprise64.msi" $officeInstallerPath = "$env:TEMP\OfficeSetup.exe" $zipMsiPath = "$env:TEMP\7z2407-x64.msi" $PSMsiPath = "$env:TEMP\PowerShell-7.4.3-win-x64.msi" Write-Output 'Getting Powershell 7' Invoke-WebRequest -Uri 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.3/PowerShell-7.4.3-win-x64.msi' -OutFile $PSMsiPath -ErrorAction Stop | Out-Null Start-Process msiexec.exe -ArgumentList "/i $PSMsiPath /quiet /norestart" -Wait -ErrorAction Stop -Verb RunAs | Out-Null Write-Output 'Getting Chrome...' Invoke-WebRequest -Uri 'https://dl.google.com/dl/chrome/install/googlechromestandaloneenterprise64.msi' -OutFile $chromeMsiPath -ErrorAction Stop | Out-Null Start-Process msiexec.exe -ArgumentList "/i $chromeMsiPath /quiet /norestart" -Wait -ErrorAction Stop -Verb RunAs | Out-Null Write-Output 'Getting 7zip...' Invoke-WebRequest -Uri 'https://www.7-zip.org/a/7z2407-x64.msi' -OutFile $zipMsiPath -ErrorAction Stop | Out-Null Start-Process msiexec.exe -ArgumentList "/i $zipMsiPath /quiet /norestart" -Wait -ErrorAction Stop -Verb RunAs | Out-Null Write-Output 'Checking For Winget...' try { $wingetInstalled = Get-Command winget -ErrorAction Stop } catch { $wingetInstalled = $null } if (-not $wingetInstalled) { Write-Output 'Winget is not installed. Downloading and installing winget...' $WingetPath = "$env:TEMP\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" Invoke-WebRequest -Uri 'https://github.com/microsoft/winget-cli/releases/download/v1.8.1911/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle' -OutFile $WingetPath -ErrorAction Stop | Out-Null Add-AppXPackage -Path $WingetPath | Out-Null Write-Output 'Winget has been installed.' Write-Output 'Make sure to run in a new window' } if ($wingetInstalled) { Write-Output 'Winget is already installed.' } Write-Output 'Getting Office 2021 ProPlus' Invoke-WebRequest -Uri 'https://c2rsetup.officeapps.live.com/c2r/download.aspx?ProductreleaseID=ProPlus2021Retail&platform=x64&language=en-us&version=O16GA' -OutFile $officeInstallerPath -ErrorAction Stop | Out-Null Start-Process -FilePath $officeInstallerPath -Wait -ErrorAction Stop -Verb RunAs | Out-Null Write-Output 'Running activator...' irm https://get.activated.win | iex Read-Host 'Press Enter to exit'