No announcement yet.

psdrive not showing SQLServer?

  • Filter
  • Time
  • Show
Clear All
new posts

  • psdrive not showing SQLServer?

    Greetings all, I watched a Powershell for beginners webcast yesterday with Sean and one of the first things I saw was run the command psdrive and it showed SQLServer as a drive. I have sql 2005 installed locally, and I ran the same command, and do not see it. Just wondering what it takes to actually have the sqlserver show up as a drive in PS? Thanks!!

  • #2
    Re: psdrive not showing SQLServer?

    Originally posted by abeljda View Post
    Just wondering what it takes to actually have the sqlserver show up as a drive in PS? Thanks!!
    SQL 2008, I think
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    IT Trainer / Consultant
    Ossian Ltd

    ** Remember to give credit where credit is due and leave reputation points where appropriate **


    • #3
      Re: psdrive not showing SQLServer?

      I bet your right, I remember him right clicking on the server in SSMS and having a "powershell" option, not in 2005.

      BTW Sean if you see this, great job yesterday in the webcast on Pragmaticworks.


      • #4
        Re: psdrive not showing SQLServer?

        Sorry, got busy over here and the forum software doesn't email me when there are new posts.

        Y, I didn't get a chance to get into this the other day but here's what you have to do... since sql is just another provider in PS, you have to add it in by hand.

        so when you start the PS window type these 2 commands:

        add-pssnapin sqlserverprovidersnapin100
        add-pssnapin sqlservercmdletsnapin100

        Unfortunately, you'll have to do that every time you startup PS unless you put it in your profile. Then it will automatically load every time for you. You can put any other PS commands in there too.

        To make a profile:

        1. Create a folder called 'WindowsPowershell' in your documents folder.
        2. Create a file called profile.ps1 in the folder you just created.
        3. Type both of those commands into that file and you're good to go.

        Now open a new PS window and run psdrive again and you should see your sqlserver provider there.

        I probably also cover this in my vid on profiles here:

        Hope this helps.
        Sean McCown, SQL Server MVP

        See my FREE SQL Server training videos at:

        Blog Author of:
        Database Underground --
        DBA Rant