Forum Discussion
Mohan579
Aug 22, 2023Copper Contributor
Application installation failure
Hi Team’ we have deployed some applications through intune’ there are many devices and users have not installed the applications what we have deployed, so how to fix the installation failures in b...
rahuljindal-MVP
Aug 24, 2023Bronze Contributor
Can you share the script over here?
Mohan579
Aug 24, 2023Copper Contributor
# Variable Definition
$App = @("FORCEPOINT ONE ENDPOINT")
$GFilter = "name = '" + $app + "'"
$Pathreg = "HKLM:\SOFTWARE\ForcePoint\Agent"
$GetApp = Get-CimInstance -ClassName Win32_Product -Filter "$GFilter"
$DeploymentVersion = "22.12"
#Action Error
$ErrorActionPreference = "Stop"
if((Test-path $Pathreg) -eq $false) # Check Registry Path conditcion
{
Write-Output "$App doesn't exist"
Exit 0
}
else
{
if ([System.String]::IsNullOrEmpty($GetApp))
{
Write-Output "$Pathreg is true, but the $App application doesn't exist"
Exit 0
}
elseif ($GetApp.Version -lt $DeploymentVersion) # Check App Version
{
Write-Output "$App version is $($Getapp.Version), removal failed please check logs and event viewer"
Exit 1
}
else
{
"The version is $($Getapp.Version), $App is up to date"
Exit 0
}
}
$App = @("FORCEPOINT ONE ENDPOINT")
$GFilter = "name = '" + $app + "'"
$Pathreg = "HKLM:\SOFTWARE\ForcePoint\Agent"
$GetApp = Get-CimInstance -ClassName Win32_Product -Filter "$GFilter"
$DeploymentVersion = "22.12"
#Action Error
$ErrorActionPreference = "Stop"
if((Test-path $Pathreg) -eq $false) # Check Registry Path conditcion
{
Write-Output "$App doesn't exist"
Exit 0
}
else
{
if ([System.String]::IsNullOrEmpty($GetApp))
{
Write-Output "$Pathreg is true, but the $App application doesn't exist"
Exit 0
}
elseif ($GetApp.Version -lt $DeploymentVersion) # Check App Version
{
Write-Output "$App version is $($Getapp.Version), removal failed please check logs and event viewer"
Exit 1
}
else
{
"The version is $($Getapp.Version), $App is up to date"
Exit 0
}
}
- rahuljindal-MVPAug 24, 2023Bronze ContributorTry changing the values for detection from wmi to registry alone. Also, if the uninstallation is straightforward and doesn’t require reboots then consider bundling the uninstallation script for old versions and installation of new version in a single package. You can also use PS app deployment toolkit.