A PowerShell Module for SQLLocalDB binary.
This module is a wrapper around the SQLLocalDB.exe binary.
PS> New-SQLLocalDBInstance -InstanceName 'test'
LocalDB instance "test" created with version 13.0.2151.0.
CMD> SQLLocalDB.exe create "test"
PS> Remove-SQLLocalDBInstance -InstanceName 'test'
LocalDB instance "test" deleted.
CMD> SQLLocalDB.exe delete "test"
PS> Remove-SQLLocalDBInstance -InstanceName 'test'-Force
LocalDB instance "test" deleted.
- There is no matching command. The Force flag simply shuts the instance down for you before removing it.
PS> Start-SQLLocalDBInstance -InstanceName 'test'
LocalDB instance "test" started.
CMD> SQLLocalDB.exe start "test"
PS> Stop-SQLLocalDBInstance -InstanceName 'test'
LocalDB instance "test" stopped.
CMD> SQLLocalDB.exe stop "test"
PS> Stop-SQLLocalDBInstance -InstanceName 'test' -ShutdownNOWAIT
LocalDB instance "test" stopped.
CMD> SQLLocalDB.exe stop "test" -i
PS> Stop-SQLLocalDBInstance -InstanceName 'test' -ExternalKill
LocalDB instance "test" stopped.
CMD> SQLLocalDB.exe stop "test" -k
PS> Start-SQLLocalDBTraceAPI
CMD> SQLLocalDB.exe trace on
PS> Stop-SQLLocalDBTraceAPI
CMD> SQLLocalDB.exe trace off
PS> Get-SQLLocalDBInstance
Name State Owner SharedName LastStartTime InstancePipeName Version AutoCreate
---- ----- ----- ---------- ------------- ---------------- ------- ----------
test Stopped UserAccount ... 3/9/2017 4:14:10 PM ... 13.0.2151.0 No
ProjectsV13 Stopped UserAccount ... 3/6/2017 8:48:40 AM ... 13.0.2151.0 No
CMD> SQLLocalDB.exe info
PS> Get-SQLLocalDBInstance -InstanceName 'test'
Name State Owner SharedName LastStartTime InstancePipeName Version AutoCreate
---- ----- ----- ---------- ------------- ---------------- ------- ----------
test Stopped UserAccount ... 3/9/2017 4:14:10 PM ... 13.0.2151.0 No
CMD> SQLLocalDB.exe info "test"
PS> Get-SQLLocalDBVersions
Version
-------
Microsoft SQL Server 2014 (12.0.2000.8)
Microsoft SQL Server 2016 (13.0.2151.0)
CMD> SQLLocalDB.exe versions
PS> Add-SQLLocalDBSharedInstance -InstanceName 'test' -SharedInstanceName 'sharetest'
Private LocalDB instance "test" shared with the shared name: "sharetest".
WARNING: You must restart the instance: "test" before sharing will take effect.
-UserAccount
and-UserSID
are optional parameters that are the same as passing this info directly to theSQLLocalDB share
command.
CMD> SQLLocalDB.exe share "" "test" "sharetest"
PS> Remove-SQLLocalDBSharedInstance -SharedInstanceName '.\sharetest'
Shared LocalDB instance ".\sharetest" unshared.
CMD> SQLLocalDB.exe unshare ".\sharetest"