Skip to content

Commit 9ec01d9

Browse files
authored
Update Initialize-CommandLineInterface.ps1
Signed-off-by: Drewry Pope <drewrypope@gmail.com>
1 parent 0c418e0 commit 9ec01d9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Initialize-CommandLineInterface.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ winget update Microsoft.AppInstaller --accept-package-agreements --accept-source
6464
winget update --all --include-unknown --accept-source-agreements --accept-package-agreements
6565
winget 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 = @'
7374
winget update Microsoft.AppInstaller --accept-package-agreements --accept-source-agreements
@@ -86,4 +87,6 @@ dism.exe /Online /Cleanup-image /Restorehealth
8687
Get-WindowsUpdate -MicrosoftUpdate -AcceptAll -Install -AutoReboot
8788
Reboot-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

Comments
 (0)