title: powershell sqlps databases doesn't exist
body: <p>Really weird issue with SQL PS provider where after a computer restart it cannot access the databases folder. Even though it appears in the ls!</p>
  
  <p>I know that this does fix itself if I go into SSMS and connect to that server,  then it seems to fix itself until the next restart but I need this to be automated. Any ideas on how to make this work reliably from a restart?</p>
  
  <p>I also think that it is ok if I close and start a new powershell session. But as the only repro is a restart it is quite disruptive to troubleshoot.</p>
  
  <pre><code>PS SQLSERVER:\&gt; cd sql\sql.ds-dev.myco.com
  PS SQLSERVER:\sql\sql.ds-dev.myco.com&gt; ls
  
  Instance Name
  -------------
  DEFAULT
  
  PS SQLSERVER:\sql\sql.ds-dev.myco.com&gt; cd default
  PS SQLSERVER:\sql\sql.ds-dev.myco.com\default&gt; ls
  Audits
  AvailabilityGroups
  BackupDevices
  Credentials
  CryptographicProviders
  Databases
  Endpoints
  JobServer
  Languages
  LinkedServers
  Logins
  Mail
  ResourceGovernor
  Roles
  ServerAuditSpecifications
  SystemDataTypes
  SystemMessages
  Triggers
  UserDefinedMessages
  
  
  PS SQLSERVER:\sql\sql.ds-dev.myco.com\default&gt; cd databases
  cd : Cannot find path 'SQLSERVER:\sql\sql.ds-dev.myco.com\default\databases' because it does not exist.
      At line:1 char:1
      + cd databases
      + ~~~~~~~~~~~~
          + CategoryInfo          : ObjectNotFound: (SQLSERVER:\sql\...fault\databases:String) [Set-Location], ItemNotFoundE
         xception
          + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
  </code></pre>
  
  <p>Tried turning on debug messages but didn't give any more information</p>
  
  <pre><code>PS SQLSERVER:\sql\sql.ds-dev.myco.com\default&gt; $debugpreference = 
  'continue'
  PS SQLSERVER:\sql\sql.ds-dev.myco.com\default&gt; cd databases
  DEBUG: ItemExists: SQLSERVER:\sql\sql.ds-
  dev.myco.com\default\databases
  DEBUG: ItemExists: SQLSERVER:\sql\sql.ds-dev.myco.com\default
  DEBUG: ItemExists: SQLSERVER:\sql\sql.ds-dev.myco.com
  DEBUG: ItemExists: SQLSERVER:\sql
  DEBUG: ItemExists: SQLSERVER:\sql\sql.ds-dev.myco.com\default\databases
  DEBUG: ItemExists: SQLSERVER:\sql\sql.ds-dev.myco.com\default
  DEBUG: ItemExists: SQLSERVER:\sql\sql.ds-dev.myco.com
  DEBUG: ItemExists: SQLSERVER:\sql
  DEBUG: ItemExists: SQLSERVER:\sql\sql.ds-dev.myco.com\default\databases
  DEBUG: ItemExists: SQLSERVER:\sql\sql.ds-dev.myco.com\default
  DEBUG: ItemExists: SQLSERVER:\sql\sql.ds-dev.myco.com
  DEBUG: ItemExists: SQLSERVER:\sql
  DEBUG: ItemExists: SQLSERVER:\sql\sql.ds-dev.myco.com\default\databases
  
  cd : Cannot find path 'SQLSERVER:\sql\sql.ds-dev.myco.com\default\databases' because it does not exist.
  At line:1 char:1
  + cd databases
  + ~~~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (SQLSERVER:\sql\...fault\databases:String) [Set-Location], ItemNotFoundE
     xception
      + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
  </code></pre>
  
  <p>Any idea's or suggestions greatly appreciated!</p>