title: test-path returns permission denied - how to do error handling
body: <p>i try to do error handling within my powershell script. but i always get an fatal. i tried a few things, e. g. try{ } catch{ } - but i did it not get to work.</p>
  
  <p>any ideas or Solutions?</p>
  
  <pre><code>Function Check-Path($Db)
  {
      If ((Test-Path $Db) –eq $false) {
          Write-Output "The file $Db does not   exist"
          break
      }
  }
  </code></pre>
  
  <p>It Returns:</p>
  
  <pre><code>Test-Path : Zugriff verweigert
  In K:\access\access.ps1:15 Zeichen:6
  + If ((Test-Path $Db) -eq $false) {
  +      ~~~~~~~~~~~~~
      + CategoryInfo          : PermissionDenied: (K:\ss.mdb:String) [Test-Path],     UnauthorizedAccessException
  + FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.TestPathCommand
  </code></pre>