Check Software Installed on Worklet

  • 29 October 2021
  • 4 replies
  • 9 views

I have a worklet that installs a software. But every time i push the worklet it re-installs each the time the schedule matches to push or i push it manually on all devices.


My question is, is there way when it detects that’s installed it should not install and exit while if it doesn’t detect, it should install it.


4 replies

I use this:


if (Test-Path -Path “C:\Program Files\SoftwareName”)

{

exit 0

}

else

{

Exit 1

}


You’ll have to make sure you add the correct location for 32 or 64 bit software

Also,


If it’s a particular version how would that work?

Do you have a software in mind you are trying? Off the top of my head, I am not sure.

You can take in Pulse Secure mind.

Reply