File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -266,9 +266,9 @@ function InstallPackage{
266266 # if winget is available, use it to install package
267267 if (Get-Command winget - ErrorAction SilentlyContinue) {
268268 Write-Host " Installing $PackageId with winget"
269- winget install -- id $PackageId - e -- source winget
269+ winget install -- id $PackageId - e -- source winget -- silent
270270 $installExitCode = $LASTEXITCODE
271- Write-Host " 'winget install --id $PackageId -e --source winget' exited with code: $ ( $installExitCode ) "
271+ Write-Host " 'winget install --id $PackageId -e --source winget --silent ' exited with code: $ ( $installExitCode ) "
272272 if ($installExitCode -eq 0 ) {
273273 # add package path to path
274274 $env: Path = [System.Environment ]::GetEnvironmentVariable(" Path" , " Machine" ) + " ;" + [System.Environment ]::GetEnvironmentVariable(" Path" , " User" ) + " ;" + $PackagePath
@@ -296,7 +296,7 @@ function InstallPackage{
296296 $tempOutFile = [System.IO.Path ]::GetTempFileName() + " .out.json"
297297
298298 $installCommandBlock = {
299- $installPackageCommand = " Install-WinGetPackage -Scope $ ( $scopeFlagValue ) -Source winget -Id $ ( $PackageId ) | ConvertTo-Json -Depth 10 | Tee-Object -FilePath '$ ( $tempOutFile ) '"
299+ $installPackageCommand = " Install-WinGetPackage -Scope $ ( $scopeFlagValue ) -Mode Silent - Source winget -Id $ ( $PackageId ) | ConvertTo-Json -Depth 10 | Tee-Object -FilePath '$ ( $tempOutFile ) '"
300300 $processCreation = Invoke-CimMethod - ClassName Win32_Process - MethodName Create - Arguments @ {CommandLine = " C:\Program Files\PowerShell\7\pwsh.exe $ ( $mtaFlag ) -Command `" $ ( $installPackageCommand ) `" " }
301301 if (! ($processCreation ) -or ! ($processCreation.ProcessId )) {
302302 Write-Error " Failed to install $PackageId package. Process creation failed."
Original file line number Diff line number Diff line change @@ -337,7 +337,7 @@ if ($RunAsUser -eq "true") {
337337 $versionFlag = " --version `" $ ( $Version ) `" "
338338 }
339339 Write-Host " Appending package install: $ ( $Package ) "
340- AppendToUserScript " winget install --id `" $ ( $Package ) `" $ ( $versionFlag ) --accept-source-agreements --accept-package-agreements"
340+ AppendToUserScript " winget install --id `" $ ( $Package ) `" $ ( $versionFlag ) --accept-source-agreements --accept-package-agreements --silent "
341341 AppendToUserScript " Write-Host `" winget exit code: `$ LASTEXITCODE`" "
342342 }
343343 # We're running in configuration file mode:
@@ -373,7 +373,7 @@ else {
373373 }
374374
375375 $installCommandBlock = {
376- $installPackageCommand = " Install-WinGetPackage -Scope $ ( $scopeFlagValue ) -Source winget -Id '$ ( $Package ) ' $ ( $versionFlag ) | ConvertTo-Json -Depth 10 | Tee-Object -FilePath '$ ( $tempOutFile ) '"
376+ $installPackageCommand = " Install-WinGetPackage -Scope $ ( $scopeFlagValue ) -Mode Silent - Source winget -Id '$ ( $Package ) ' $ ( $versionFlag ) | ConvertTo-Json -Depth 10 | Tee-Object -FilePath '$ ( $tempOutFile ) '"
377377 $processCreation = Invoke-CimMethod - ClassName Win32_Process - MethodName Create - Arguments @ {CommandLine = " C:\Program Files\PowerShell\7\pwsh.exe $ ( $mtaFlag ) -Command `" $ ( $installPackageCommand ) `" " }
378378 if (! ($processCreation ) -or ! ($processCreation.ProcessId )) {
379379 Write-Error " Failed to install package. Process creation failed."
You can’t perform that action at this time.
0 commit comments