There is no check you could run that wouldn't run the risk of being invalid when you finally execute the Get-PWFolders command. Even if it was the command immediately before the Get-PWFolders there is a chance the user renamed or deleted at exactly that…