Sha256: a21595cf8939bfd89141204f988be0826eb0dccce16b2d36055321e1f93340d0

Contents?: true

Size: 1011 Bytes

Versions: 61

Compression:

Stored size: 1011 Bytes

Contents

Write-Output "Setting up..."
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null

Write-Output "Setting variables..."
$serverName = $env:COMPUTERNAME
$instances = @('SQL2012SP1', 'SQL2014', 'SQL2016')
$smo = 'Microsoft.SqlServer.Management.Smo.'
$wmi = new-object ($smo + 'Wmi.ManagedComputer')

Write-Output "Configure Instances..."
foreach ($instance in $instances) {
  Write-Output "Instance $instance ..."
  Write-Output "Enable TCP/IP and port 1433..."
  $uri = "ManagedComputer[@Name='$serverName']/ServerInstance[@Name='$instance']/ServerProtocol[@Name='Tcp']"
  $tcp = $wmi.GetSmoObject($uri)
  $tcp.IsEnabled = $true
  foreach ($ipAddress in $Tcp.IPAddresses) {
    $ipAddress.IPAddressProperties["TcpDynamicPorts"].Value = ""
    $ipAddress.IPAddressProperties["TcpPort"].Value = "1433"
  }
  $tcp.Alter()
}

Set-Service SQLBrowser -StartupType Manual
Start-Service SQLBrowser

Version data entries

61 entries across 61 versions & 2 rubygems

Version Path
tiny_tds-2.1.5-x64-mingw32 test/appveyor/dbsetup.ps1
tiny_tds-2.1.5-x86-mingw32 test/appveyor/dbsetup.ps1
tiny_tds-2.1.5 test/appveyor/dbsetup.ps1
tiny_tds-2.1.4-x64-mingw32 test/appveyor/dbsetup.ps1
tiny_tds-2.1.4-x86-mingw32 test/appveyor/dbsetup.ps1
tiny_tds-2.1.4 test/appveyor/dbsetup.ps1
tiny_tds-2.1.4.pre2-x64-mingw32 test/appveyor/dbsetup.ps1
tiny_tds-2.1.4.pre2-x86-mingw32 test/appveyor/dbsetup.ps1
tiny_tds-2.1.4.pre2 test/appveyor/dbsetup.ps1
tiny_tds-2.1.4.pre-x64-mingw32 test/appveyor/dbsetup.ps1
tiny_tds-2.1.4.pre-x86-mingw32 test/appveyor/dbsetup.ps1
tiny_tds-2.1.4.pre test/appveyor/dbsetup.ps1
tiny_tds-2.1.3-x64-mingw32 test/appveyor/dbsetup.ps1
tiny_tds-2.1.3-x86-mingw32 test/appveyor/dbsetup.ps1
tiny_tds-2.1.3 test/appveyor/dbsetup.ps1
tiny_tds-2.1.3.pre-x86-mingw32 test/appveyor/dbsetup.ps1
tiny_tds-2.1.3.pre-x64-mingw32 test/appveyor/dbsetup.ps1
tiny_tds-2.1.3.pre test/appveyor/dbsetup.ps1
vm_tiny_tds-2.1.2 test/appveyor/dbsetup.ps1
tiny_tds-2.1.2-x86-mingw32 test/appveyor/dbsetup.ps1