Skip to content

Commit

Permalink
Increases accuracy
Browse files Browse the repository at this point in the history
  • Loading branch information
Romanitho committed Jul 7, 2022
1 parent 6b698a6 commit ff906c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions winget-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function Add-ScopeMachine {
#Check if app is installed
function Confirm-Install ($AppID) {
#Get "Winget List AppID"
$InstalledApp = & $winget list --Id $AppID --accept-source-agreements | Out-String
$InstalledApp = & $winget list --Id $AppID -e --accept-source-agreements | Out-String

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

#Return if AppID exists
if ($WingetApp -match [regex]::Escape($AppID)) {
Expand Down Expand Up @@ -220,7 +220,7 @@ function Install-App ($AppID, $AppArgs) {
if (!($IsInstalled)) {
#Install App
Write-Log "-> Installing $AppID..." "Yellow"
$WingetArgs = "install --id $AppID --accept-package-agreements --accept-source-agreements -h $AppArgs" -split " "
$WingetArgs = "install --id $AppID -e --accept-package-agreements --accept-source-agreements -h $AppArgs" -split " "
Write-Log "-> Running: `"$Winget`" $WingetArgs"
& "$Winget" $WingetArgs | Tee-Object -file $LogFile -Append

Expand Down Expand Up @@ -258,7 +258,7 @@ function Uninstall-App ($AppID, $AppArgs) {
if ($IsInstalled) {
#Uninstall App
Write-Log "-> Uninstalling $AppID..." "Yellow"
$WingetArgs = "uninstall --id $AppID --accept-source-agreements -h" -split " "
$WingetArgs = "uninstall --id $AppID -e --accept-source-agreements -h" -split " "
Write-Log "-> Running: `"$Winget`" $WingetArgs"
& "$Winget" $WingetArgs | Tee-Object -file $LogFile -Append

Expand Down

0 comments on commit ff906c1

Please sign in to comment.