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.
Setting -ErrorAction to silently continue depends on how you are depended on the cmdlet execution. Here if the script expects the path to be deleted to proceed with some other decision down in the script, then it won’t be a good option, otherwise its a possible solution.
Because there are many reasons why an error can occur.