The -ErrorAction Stop is for error trapping. It will only stop the script if the Test-path cmdlet produces an error when it tries to check the path. If the path doesn't exist, it will not produce an error, it will return $false.
↧