Hi all! Apologies ahead of time if this has been covered. Any help you can provide would be very much appreciated!
I’m running into a problem with the test-path cmdlet , which i’m certain is a result of my method. When I leverage test-path within a variable it keeps the result value of the time it was set. Even if the result is true, it will still return false and vice versa. What I’m trying to do is test for the existence of a value within an if-else statement.
if ($testpath -eq $true)
Remove-Item -Path “$env:SystemDrive:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\file.lnk” -Force -ErrorAction SilentlyContinue