FlorianSLZ / IntuneWin32Deployer

Create and deploy winget and chocolatey (win32) apps to Intune with one click!
GNU General Public License v3.0
49 stars 10 forks source link

Typo in proactive remediation scripts #20

Open the-project-group opened 1 year ago

the-project-group commented 1 year ago

Just found a small typo: # no upgared, no action needed Detect:

    $app_2upgrade = "Mozilla.Firefox"

    $Winget = Get-ChildItem -Path (Join-Path -Path (Join-Path -Path $env:ProgramFiles -ChildPath "WindowsApps") -ChildPath "Microsoft.DesktopAppInstaller*_x64*\winget.exe")

    if ($(&$winget upgrade) -like "* $app_2upgrade *") {
        Write-Host "Upgrade available for: $app_2upgrade"
        exit 1 # upgrade available, remediation needed
    }
    else {
            Write-Host "No Upgrade available"
            exit 0 # no upgared, no action needed
    } 

Write-Error "Error while installing upgarde for: $app_2upgrade Remediate:


    $app_2upgrade = "Mozilla.Firefox"

    try{
        $Winget = Get-ChildItem -Path (Join-Path -Path (Join-Path -Path $env:ProgramFiles -ChildPath "WindowsApps") -ChildPath "Microsoft.DesktopAppInstaller*_x64*\winget.exe")

        # upgrade command
        &$winget upgrade --exact $app_2upgrade --silent --force --accept-package-agreements --accept-source-agreements
        exit 0

    }catch{
        Write-Error "Error while installing upgarde for: $app_2upgrade"
        exit 1

    }