Trying to install some packages with winget inside a script but for some reason it just opens a new powershell window for each winget command which it doesnt if i just type it out myself
issue being it continues on with the rest of the script but like 2 seconds after that there is a restart command so it cant finish
try{
winget install "7zip.7zip" --source "winget" --silent --accept-package-agreements --accept-source-agreements
winget install "Foxit PDF Reader" --source "msstore" --silent --accept-package-agreements --accept-source-agreements
winget install "Google.Chrome" --source "winget" --silent --accept-package-agreements --accept-source-agreements
winget install "Oracle.JavaRuntimeEnvironment" --source "winget" --silent --accept-package-agreements --accept-source-agreements
}
#installeert via ninite als winget faalt
catch {
Invoke-WebRequest -Uri "https://ninite.com/7zip-adoptjavax8-chrome-foxit/ninite.exe" -OutFile "H:\Temp\Ninite.exe"
Start-Process "H:\Temp\Ninite.exe" -Wait
}