Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 29d5be0

Browse files
authored
Merge pull request #85 from Romanitho/fix
force winget source
2 parents fba5dc9 + 120a041 commit 29d5be0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

winget-install.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ function Add-ScopeMachine {
158158
#Check if app is installed
159159
function Confirm-Install ($AppID) {
160160
#Get "Winget List AppID"
161-
$InstalledApp = & $winget list --Id $AppID -e --accept-source-agreements | Out-String
161+
$InstalledApp = & $winget list --Id $AppID -e --accept-source-agreements -s winget | Out-String
162162

163163
#Return if AppID exists in the list
164164
if ($InstalledApp -match [regex]::Escape($AppID)) {
@@ -172,7 +172,7 @@ function Confirm-Install ($AppID) {
172172
#Check if App exists in Winget Repository
173173
function Confirm-Exist ($AppID) {
174174
#Check is app exists in the winget repository
175-
$WingetApp = & $winget show --Id $AppID -e --accept-source-agreements | Out-String
175+
$WingetApp = & $winget show --Id $AppID -e --accept-source-agreements -s winget | Out-String
176176

177177
#Return if AppID exists
178178
if ($WingetApp -match [regex]::Escape($AppID)) {
@@ -256,7 +256,7 @@ function Install-App ($AppID, $AppArgs) {
256256

257257
#Install App
258258
Write-Log "-> Installing $AppID..." "Yellow"
259-
$WingetArgs = "install --id $AppID -e --accept-package-agreements --accept-source-agreements -h $AppArgs" -split " "
259+
$WingetArgs = "install --id $AppID -e --accept-package-agreements --accept-source-agreements -s winget -h $AppArgs" -split " "
260260
Write-Log "-> Running: `"$Winget`" $WingetArgs"
261261
& "$Winget" $WingetArgs | Tee-Object -file $LogFile -Append
262262

0 commit comments

Comments
 (0)