Skip to content

Commit

Permalink
Merge pull request #21 from KnifMelti/main
Browse files Browse the repository at this point in the history
Start-Process/Get-Process
  • Loading branch information
Romanitho authored Apr 13, 2022
2 parents 5bd4df3 + b91d24e commit dadff39
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions winget-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ function Install-App ($AppID,$AppArgs){
if (!($IsInstalled)){
#Install App
Write-Log "Installing $AppID..." "Yellow"
$Command = "$winget install --id $AppID --silent --accept-package-agreements --accept-source-agreements $AppArgs"
cmd.exe /c $Command
$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() }

#Check if mods exist
$ModsInstall = Test-ModsInstall $AppID
Expand Down Expand Up @@ -191,9 +192,10 @@ function Uninstall-App ($AppID,$AppArgs){
if ($IsInstalled){
#Uninstall App
Write-Log "Uninstalling $AppID..." "Yellow"
$Command = "$winget uninstall --id $AppID --silent --accept-source-agreements $AppArgs"
cmd.exe /c $Command

$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() }

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

0 comments on commit dadff39

Please sign in to comment.