I am attempting to run a .exe file for an app which is installed but requires to be activated. This would be a fairly easy process but the directory with .exe changes name slightly with each install. For example a number is added to each folder after the install (Different devices have different numbers) e.g. test1 and then test2. How could I use a wild card to target the folder as it changes?
Example code:
Start-Process -FilePath "\C:\ProgramData\app*/test.exe"
Please note: the app is not real, this is just for display purposes.
Your path seems to be incorrect. Wildcards should work in PowerShell. For example, the below wildcard works for me in PowerShell 5.0:
Try running Start-Process -FilePath "C:\ProgramData\app*\test.exe"