Adding SQL Server registered servers in Powershell
I am attempting to use Powershell v2 to add registered servers in SQL Server Management Studio 2008.

So far I have the following outline


    add-pssnapin SqlServerProviderSnapin100
    add-pssnapin SqlServerCmdletSnapin100
    ##get-pssnapin
    
    sl "SQLSERVER:\SQLRegistration\Database Engine Server Group"
    
    new-item SERVERNAME\INSTANCENAME -itemtype registration -Value "server=SERVERNAME\INSTANCENAME;integrated security=false;User Id=SA;Password=foofoo"


The problem I have is with the registered server friendly name. We require slashes in it as we have named instances with the same names on different servers.

Regardless of what I try I get the following error message.

> The type is not a known type for the
> file system. Only "file" and
> "directory" can be specified

I have tried enclosing in quotes, using grave as an escape character. None of which works for me.

Cheers    
David  
Adding SQL Server registered servers in Powershell
===

I am attempting to use Powershell v2 to add registered servers in SQL Server Management Studio 2008.

So far I have the following outline


    add-pssnapin SqlServerProviderSnapin100
    add-pssnapin SqlServerCmdletSnapin100
    ##get-pssnapin
    
    sl "SQLSERVER:\SQLRegistration\Database Engine Server Group"
    
    new-item SERVERNAME\INSTANCENAME -itemtype registration -Value "server=SERVERNAME\INSTANCENAME;integrated security=false;User Id=SA;Password=foofoo"


The problem I have is with the registered server friendly name. We require slashes in it as we have named instances with the same names on different servers.

Regardless of what I try I get the following error message.

> The type is not a known type for the
> file system. Only "file" and
> "directory" can be specified

I have tried enclosing in quotes, using grave as an escape character. None of which works for me.

Cheers    
David  