I have a PS script that calls an external program at the end. We're running into an issue now where the author of the external program is making x86 and x64 versions of the product.
What I'd like to do is have PS look for the program in Program Files (x86) and if it's not there silently continue and look in Program Files. Then if it's not in either places through up a nice error that says "Hey chuckles is the app installed?"
Or something like that.
How would you guys do this? Right now I'm putting the program location in a variable like so:
Powershell
1 | $strXnConvert="C:\Program Files (x86)\Blah\blah.exe" |