sql server - powershell sqlps databases doesn't exist -
really weird issue sql ps provider after computer restart cannot access databases folder. though appears in ls!
i know fix if go ssms , connect server, seems fix until next restart need automated. ideas on how make work reliably restart?
i think ok if close , start new powershell session. repro restart quite disruptive troubleshoot.
ps sqlserver:\> cd sql\sql.ds-dev.myco.com ps sqlserver:\sql\sql.ds-dev.myco.com> ls instance name ------------- default ps sqlserver:\sql\sql.ds-dev.myco.com> cd default ps sqlserver:\sql\sql.ds-dev.myco.com\default> 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> cd databases cd : cannot find path 'sqlserver:\sql\sql.ds-dev.myco.com\default\databases' because not exist. @ line:1 char:1 + cd databases + ~~~~~~~~~~~~ + categoryinfo : objectnotfound: (sqlserver:\sql\...fault\databases:string) [set-location], itemnotfounde xception + fullyqualifiederrorid : pathnotfound,microsoft.powershell.commands.setlocationcommand
tried turning on debug messages didn't give more information
ps sqlserver:\sql\sql.ds-dev.myco.com\default> $debugpreference = 'continue' ps sqlserver:\sql\sql.ds-dev.myco.com\default> 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 not exist. @ line:1 char:1 + cd databases + ~~~~~~~~~~~~ + categoryinfo : objectnotfound: (sqlserver:\sql\...fault\databases:string) [set-location], itemnotfounde xception + fullyqualifiederrorid : pathnotfound,microsoft.powershell.commands.setlocationcommand
any idea's or suggestions appreciated!
Comments
Post a Comment