@@ -64,10 +64,11 @@ winget update Microsoft.AppInstaller --accept-package-agreements --accept-source
6464winget update -- all -- include- unknown -- accept- source- agreements -- accept- package- agreements
6565winget upgrade -- all -- include- unknown -- accept- source- agreements -- accept- package- agreements
6666
67- Start-Process powershell.exe - ArgumentList " -Command `" Register-PSRepository -Default ; Set-PSRepository PSGallery ; Update-Help -ErrorAction SilentlyContinue ; update-module * ; Update-Script *`" "
68- Start-Process pwsh.exe - ArgumentList " -Command `" Register-PSRepository -Default ; Set-PSRepository PSGallery ; Update-Help -ErrorAction SilentlyContinue ; update-module * -AcceptLicense ; Update-Script * -AcceptLicense`" "
69- Start-Process powershell.exe - ArgumentList " -Command `" Register-PSRepository -Default ; Set-PSRepository PSGallery ; Update-Help -ErrorAction SilentlyContinue ; update-module * ; Update-Script * `" " - Verb RunAs
70- Start-Process pwsh.exe - ArgumentList " -Command `" Register-PSRepository -Default ; Set-PSRepository PSGallery ; Update-Help -ErrorAction SilentlyContinue ; update-module * -AcceptLicense ; Update-Script * -AcceptLicense`" " - Verb RunAs
67+ $process1 = Start-Process powershell.exe - ArgumentList " -Command `" Register-PSRepository -Default ; Set-PSRepository PSGallery ; Update-Help -ErrorAction SilentlyContinue ; update-module * ; Update-Script *`" " - PassThru
68+ $process2 = Start-Process pwsh.exe - ArgumentList " -Command `" Register-PSRepository -Default ; Set-PSRepository PSGallery ; Update-Help -ErrorAction SilentlyContinue ; update-module * -AcceptLicense ; Update-Script * -AcceptLicense`" " - PassThru
69+ $process3 = Start-Process powershell.exe - ArgumentList " -Command `" Register-PSRepository -Default ; Set-PSRepository PSGallery ; Update-Help -ErrorAction SilentlyContinue ; update-module * ; Update-Script * `" " - Verb RunAs - PassThru
70+ $process4 = Start-Process pwsh.exe - ArgumentList " -Command `" Register-PSRepository -Default ; Set-PSRepository PSGallery ; Update-Help -ErrorAction SilentlyContinue ; update-module * -AcceptLicense ; Update-Script * -AcceptLicense`" " - Verb RunAs - PassThru
71+ $process1 , $process2 , $process3 , $process4 | Wait-Process
7172
7273$adminScript = @'
7374winget update Microsoft.AppInstaller --accept-package-agreements --accept-source-agreements
@@ -86,4 +87,6 @@ dism.exe /Online /Cleanup-image /Restorehealth
8687Get-WindowsUpdate -MicrosoftUpdate -AcceptAll -Install -AutoReboot
8788Reboot-Computer
8889'@
89- Start-Process powershell.exe - ArgumentList " -Command `" $adminScript `" " - Verb RunAs
90+ $process5 = Start-Process powershell.exe - ArgumentList " -Command `" $adminScript `" " - Verb RunAs
91+ $process5 | Wait-Process
92+
0 commit comments