dataplat / dbatools

šŸš€ SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.48k stars 805 forks source link

WID (Windows Internal Database) support for dbainstanceparamter #8695

Open potatoqualitee opened 1 year ago

potatoqualitee commented 1 year ago

Summarize Functionality

This works with Invoke-SqlCmd

https://www.sqlshack.com/managing-the-windows-internal-database-wid/

Invoke-Sqlcmd -ServerInstance np:\\.\pipe\MICROSOFT##WID\tsql\query -Database master -Query "select name from sys.databases"

But we can't use the same with ours

Connect-DbaInstance -SqlInstance 'np:\\.\pipe\MICROSOFT##WID\tsql\query'
Connect-DbaInstance : Cannot process argument transformation on parameter 'SqlInstance'. Cannot convert value
"np:\\.\pipe\MICROSOFT##WID\tsql\query" to type "Dataplat.Dbatools.Parameter.DbaInstanceParameter[]". Error: "Cannot convert value
"np:\\.\pipe\MICROSOFT##WID\tsql\query" to type "Dataplat.Dbatools.Parameter.DbaInstanceParameter". Error: "Failed to parse instance
name: np:\\.\pipe\MICROSOFT##WID\tsql\query""

this is another way to do it which also doesnt work šŸ¤”

$connstring = 'server=\\.\pipe\MICROSOFT##WID\tsql\query;database=SUSDB;trusted_connection=true;'
Connect-DbaInstance -SqlInstance $connstring

Is there a command that is similiar or close to what you are looking for?

Yes

Technical Details

No response

kjustin765 commented 1 year ago

Anyone currently working on this? I don't mind jumping in to help if needed.

wsmelton commented 1 year ago

@potatoqualitee do you intend to implement this in the library?

@kjustin765 this particular one requires changes to our C# codebase in another repository (dbatools.library). That particular repository we are not accepting contributions to at this time.