Skip to content

Commit

Permalink
added winget logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Romanitho authored May 12, 2022
1 parent b9bb7e1 commit 941bd6c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions winget-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,8 @@ function Install-App ($AppID,$AppArgs){
if (!($IsInstalled)){
#Install App
Write-Log "Installing $AppID..." "Yellow"
$Command = "install --id $AppID --silent --accept-package-agreements --accept-source-agreements $AppArgs"
Start-Process -FilePath "$winget" -ArgumentList "$Command" -NoNewWindow
Get-Process winget, AppInstallerCLI -ErrorAction SilentlyContinue | Foreach-Object { $_.WaitForExit() }
$Command = "$winget install --id $AppID --silent --accept-package-agreements --accept-source-agreements $AppArgs"
Invoke-Expression $Command | Tee-Object -file $LogFile -Append

#Check if install is ok
$IsInstalled = Confirm-Install $AppID
Expand Down Expand Up @@ -226,9 +225,8 @@ function Uninstall-App ($AppID,$AppArgs){
if ($IsInstalled){
#Uninstall App
Write-Log "Uninstalling $AppID..." "Yellow"
$Command = "uninstall --id $AppID --silent --accept-source-agreements $AppArgs"
Start-Process -FilePath "$winget" -ArgumentList "$Command" -NoNewWindow
Get-Process winget, AppInstallerCLI -ErrorAction SilentlyContinue | Foreach-Object { $_.WaitForExit() }
$Command = "$winget uninstall --id $AppID --silent --accept-source-agreements $AppArgs"
Invoke-Expression $Command | Tee-Object -file $LogFile -Append

#Check if mods exist
$ModsUninstall = Test-ModsUninstall $AppID
Expand Down

0 comments on commit 941bd6c

Please sign in to comment.