diff --git a/config/applications.json b/config/applications.json index a7d7bb6f..887f4f12 100644 --- a/config/applications.json +++ b/config/applications.json @@ -1728,14 +1728,6 @@ "link": "https://proton.me/authenticator", "winget": "Proton.ProtonAuthenticator" }, - "spotify": { - "category": "Multimedia Tools", - "choco": "spotify", - "content": "Spotify", - "description": "Spotify is a digital music service that gives you access to millions of songs, podcasts, and videos from artists all over the world.", - "link": "https://www.spotify.com/", - "winget": "Spotify.Spotify" - }, "processmonitor": { "category": "Microsoft Tools", "choco": "procexp", diff --git a/functions/private/Install-WinUtilProgramWinget.ps1 b/functions/private/Install-WinUtilProgramWinget.ps1 index 97180691..3253834e 100644 --- a/functions/private/Install-WinUtilProgramWinget.ps1 +++ b/functions/private/Install-WinUtilProgramWinget.ps1 @@ -30,24 +30,16 @@ Function Install-WinUtilProgramWinget { .PARAMETER wingetId The Id of the Program that Winget should Install/Uninstall - .PARAMETER scope - Determines the installation mode. Can be "user" or "machine" (For more info look at the winget documentation) - - .PARAMETER credential - The PSCredential Object of the user that should be used to run winget - .NOTES Invoke Winget uses the public variable $Action defined outside the function to determine if a Program should be installed or removed #> param ( - [string]$wingetId, - [string]$scope = "", - [PScredential]$credential = $null + [string]$wingetId ) $commonArguments = "--id $wingetId --silent" $arguments = if ($Action -eq "Install") { - "install $commonArguments --accept-source-agreements --accept-package-agreements $(if ($scope) {" --scope $scope"})" + "install $commonArguments --accept-source-agreements --accept-package-agreements" } else { "uninstall $commonArguments" } @@ -60,10 +52,6 @@ Function Install-WinUtilProgramWinget { NoNewWindow = $true } - if ($credential) { - $processParams.credential = $credential - } - return (Start-Process @processParams).ExitCode } @@ -87,28 +75,6 @@ Function Install-WinUtilProgramWinget { return $true } - Write-Host "Attempt installation of $($Program) with User scope" - $status = Invoke-Winget -wingetId $Program -scope "user" - if ($status -eq 0) { - Write-Host "$($Program) installed successfully with User scope." - return $true - } elseif ($status -eq -1978335189) { - Write-Host "$($Program) No applicable update found" - return $true - } - - $userAcknowledgment = [System.Windows.MessageBox]::Show("You need to input your password to install $($Program) with specific user credentials.", "User credential Prompt", [System.Windows.MessageBoxButton]::Ok) - if ($userAcknowledgment -eq 'Ok') { - $getcreds = Get-Credential $env:USERNAME - $status = Invoke-Winget -wingetId $Program -credential $getcreds - if ($status -eq 0) { - Write-Host "$($Program) installed successfully with User prompt." - return $true - } - } else { - Write-Host "Skipping installation with specific user credentials." - } - Write-Host "Failed to install $($Program)." return $false }