As for this line, you’re also hard-coding a check for the WOW6432Node key within the registry, which is fine(-ish), however won’t work if running Invoke-AppDeployToolkit.ps1 via a 32-bit PowerShell process (i.e. Intune with an Install line of something like powershell.exe -File Invoke-AppDeployToolkit.ps1). This is because the Intune Management Extension (sidecar) is a 32-bit process, so everything it spawns is 32-bit unless specified otherwise (i.e. %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe -File Invoke-AppDeployToolkit.ps1`).
The issue I have is, the test-path is correct but when running in the tool, it does not seem to pick it up.
I see your point with the msi uninstall command but, how does that work if its a .exe without a product code? This is where we use simple test-path commands to look for install directories or reg keys.
What if the product code varies from your test and prod devices? It looks like an Acrobat code, they vary depending on the language installed etc. Using Get-ADTApplication -Name Acrobat will get you all apps that have Acrobat in the name.
The toolkit doesn’t have all this cool ■■■■ in it for no reason, it’s all there to make your life easier .
Of course that’s never going to work, and it’s not what I had in the example I gave you either. The output from Get-ADTApplication is an object, not a boolean. You should be testing that the variable isn’t null, not that it equals true.
You’re also doing your own uninstall command… See my example code again:
If I run the command locally (the uninstall) it uninstalls fine but it isn’t detecting that the install is present still.
I still dont understand how a simple test-path to a reg entry does not come up as true in a if statement either. This method worked fine in previous versions.
Are you aware you have an extra single quote after the ++ and before the double quotes?
With the extra single quote the path is invalid so is correctly returning True
Without the extra single quote the path is valid so is correctly returning False
N.B. To help us help you in the future, if you need to post an example of your code on this forum, please use a code block (click on the </> toolbar button and it will create two lines of three escape characters or: ```
```
Then paste your code between these 2 lines, rather than pasting a screen grab), we can then easily copy and rework your code and post it back - rather than retyping it each time
Thanks
Thanks for getting back to me but, that also does not work. I have used many test-paths in v3 and they work fine but in v4, none seem to work correctly.
This also bypasses. I admit, my syntax maybe incorrect with that as I am trying to get my head around these new commands but, a basic test-path should work.