I need to detect if an application is already installed in sccm. i have searched that i can use a custom script that does de test and returns the status of the installation depending on the exit-code of the script.
I have and .exe that does this validation, I have created this powershell script that executes de .exe and returns true or false.
$program = ".\teststatus.exe"
$programArgs = "/output" , "console", "STATUS"
Invoke-Command -ScriptBlock { & $program $programArgs }
$LASTEXITCODE
if ($LASTEXITCODE -eq "0")
{
$true
}
else
{
$false
}
!!this .exe is included on the files of the application!!
¿My question is what path I must set in the variable $program that contain the location of the .exe in other to execute it?