Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Tasks/git-clone/main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ function InstallPackage{
# if winget is available, use it to install package
if (Get-Command winget -ErrorAction SilentlyContinue) {
Write-Host "Installing $PackageId with winget"
winget install --id $PackageId -e --source winget
winget install --id $PackageId -e --source winget --silent
$installExitCode = $LASTEXITCODE
Write-Host "'winget install --id $PackageId -e --source winget' exited with code: $($installExitCode)"
Write-Host "'winget install --id $PackageId -e --source winget --silent' exited with code: $($installExitCode)"
if ($installExitCode -eq 0) {
# add package path to path
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + ";" + $PackagePath
Expand Down Expand Up @@ -296,7 +296,7 @@ function InstallPackage{
$tempOutFile = [System.IO.Path]::GetTempFileName() + ".out.json"

$installCommandBlock = {
$installPackageCommand = "Install-WinGetPackage -Scope $($scopeFlagValue) -Source winget -Id $($PackageId) | ConvertTo-Json -Depth 10 | Tee-Object -FilePath '$($tempOutFile)'"
$installPackageCommand = "Install-WinGetPackage -Scope $($scopeFlagValue) -Mode Silent -Source winget -Id $($PackageId) | ConvertTo-Json -Depth 10 | Tee-Object -FilePath '$($tempOutFile)'"
$processCreation = Invoke-CimMethod -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine="C:\Program Files\PowerShell\7\pwsh.exe $($mtaFlag) -Command `"$($installPackageCommand)`""}
if (!($processCreation) -or !($processCreation.ProcessId)) {
Write-Error "Failed to install $PackageId package. Process creation failed."
Expand Down
4 changes: 2 additions & 2 deletions Tasks/winget/main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ if ($RunAsUser -eq "true") {
$versionFlag = "--version `"$($Version)`""
}
Write-Host "Appending package install: $($Package)"
AppendToUserScript "winget install --id `"$($Package)`" $($versionFlag) --accept-source-agreements --accept-package-agreements"
AppendToUserScript "winget install --id `"$($Package)`" $($versionFlag) --accept-source-agreements --accept-package-agreements --silent"
AppendToUserScript "Write-Host `"winget exit code: `$LASTEXITCODE`""
}
# We're running in configuration file mode:
Expand Down Expand Up @@ -373,7 +373,7 @@ else {
}

$installCommandBlock = {
$installPackageCommand = "Install-WinGetPackage -Scope $($scopeFlagValue) -Source winget -Id '$($Package)' $($versionFlag) | ConvertTo-Json -Depth 10 | Tee-Object -FilePath '$($tempOutFile)'"
$installPackageCommand = "Install-WinGetPackage -Scope $($scopeFlagValue) -Mode Silent -Source winget -Id '$($Package)' $($versionFlag) | ConvertTo-Json -Depth 10 | Tee-Object -FilePath '$($tempOutFile)'"
$processCreation = Invoke-CimMethod -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine="C:\Program Files\PowerShell\7\pwsh.exe $($mtaFlag) -Command `"$($installPackageCommand)`""}
if (!($processCreation) -or !($processCreation.ProcessId)) {
Write-Error "Failed to install package. Process creation failed."
Expand Down
Loading