🚀 SQL Server automation and instance migrations have never been safer, faster or freer
MIT License
Bot releases are hidden (Show)
Published by potatoqualitee about 3 years ago
Published by potatoqualitee about 3 years ago
Published by potatoqualitee about 3 years ago
Published by potatoqualitee about 3 years ago
Get-DbaAgentJob - Fix for more than one result per job by @andreasjordan
New-DbaAvailabilityGroup - Add config for FailureConditionLevel and change the default by @andreasjordan
Export-DbaInstance - Add AzureCredential option by @potatoqualitee
Get-DbaConnectedInstance / Disconnect-DbaInstance by @potatoqualitee
Published by potatoqualitee about 3 years ago
Published by potatoqualitee about 3 years ago
Add New-DbaDbSnapshot test to/from Linux on GitHub Actions by @potatoqualitee
Close connection inside of commands that use non-pooled connections by @andreasjordan
New command: Get-DbaOleDbProvider + Add support in Export-DbaInstance by @potatoqualitee
Connect-DbaInstance - Use DAC with new switch DedicatedAdminConnection by @andreasjordan
Get-DbaBuildReference -> Get-DbaBuild by @potatoqualitee
Set-DbaDbCompression and Get-DbaDbCompression - Add Table Parameter by @potatoqualitee
Connect-Dbainstance - Error Record / Message to include hostname by @potatoqualitee
New command: Set-DbaAgentOperator by @potatoqualitee
Set-DbaPowerPlan - Fix for changing more than one computer at once by @andreasjordan
dbatools config: add ability to disable elevation requirement by @potatoqualitee
Update-DbaServiceAccount - Allow for not restarting services by @potatoqualitee
Update-Dbatools -- Add -Cleanup parameter by @potatoqualitee
New commands: Get/Set/Add/Remove-DbaExtendedProperty by @potatoqualitee
TEPP Update by @andreasjordan
Published by potatoqualitee about 3 years ago
Published by potatoqualitee about 3 years ago
Remove runspaces on close of PowerShell ISE by @andreasjordan
SpConfigure Commands -- Add back auto-complete for Name, ConfigName, ExcludeConfigName by @potatoqualitee
Get-DbaCmObject - Fix ComputerName when using PowerShell Remoting by @andreasjordan
Get-DbaDbTable - Add Schema Parameter by @potatoqualitee
Published by potatoqualitee about 3 years ago
This is a big one!
Thanks to @andreasjordan, @niphlod, @Stuart-Moore, @JPRuskin and @wsmelton for helping make this release happen 🤩 A list of all PRs included in this release can be found way down below.
We've updated from an SMO version (150.x) released in 2019 to the newest SMO library, released in the past 3 months: version 161.46367.54. The new version includes a ton of bug fixes and new functionality.
Now, we also use Microsoft.Data
instead of System.Data
.
The new version does require a much higher version of .NET -- 4.6.2, up from whatever allowed us to run PowerShell v3. Fortunately, .NET 4.6.2 was introduced in 2018, so everyone has been given a chance to upgrade. To see your current version of .NET, you can run the following from PowerShell:
[System.Runtime.InteropServices.RuntimeInformation]::get_FrameworkDescription()
dbatools also still works on older versions of Windows -- we tested on Windows Server 2008 R2 and Windows 7 with PowerShell v3 (bravo Microsoft SMO team!).
You can still connect to SQL Server 2000 as well.
We held off upping our requirements for as long as possible because we priortize backwads compatibility, but we also rely heavily on SQL Management Objects and newer versions have the bug fixes we needed addressed.
If you can't upgrade to .NET 4.6.2, you can still use the version of dbatools we released on July 13, 2021 by running: Install-Module -Name dbatools -RequiredVersion 1.0.173
Connect-DbaInstance has been rewritten and uses new approaches to connect. If you have any issues, please let us know. You can use the old code path by running:
Set-DbatoolsConfig -FullName sql.connection.legacy -Value $true
Now, it's even easier to connect to Azure with Tokens.
# Auto-generated using Tenant (these tokens last one hour)
Connect-DbaInstance -SqlInstance sample.database.windows.net -Tenant $tenantid -SqlCredential $cred
# Create a token using dbatools
$token = (New-DbaAzAccessToken -Type RenewableServicePrincipal -Subtype AzureSqlDb -Tenant $tenantid -Credential $cred).GetAccessToken()
Connect-DbaInstance -SqlInstance sample.database.windows.net -Accesstoken $token
# Create a token using Get-AzAccessToken
$azureCredential = Get-Credential -Message 'Azure Credential'
$azureAccount = Connect-AzAccount -Credential $azureCredential
$token = (Get-AzAccessToken -ResourceUrl https://database.windows.net).Token
Connect-DbaInstance -SqlInstance sample.database.windows.net -Accesstoken $token -OutVariable server
Invoke-DbaQuery -SqlInstance $server -Query "Select 1"
Note that generating access tokens is not supported on Core, so when using Tenant on Core, we rewrite the connection string with Active Directory Service Principal authentication instead.
The dbatools.dll is now signed too 🥳 We've signed our ps files for years, and now the DLL is signed too. It shouldn't make an impact one way or another but it's still cool anyway.
A number of commands have been modified to support Linux and now 77.2% of commands are cross-platform!
The biggest highlight is that Publish-DbaDacPackage
, Export-DbaDacPackage
, New-DbaDacProfile
are now available on Linux. This means that you can do some pretty easy deployments on your favorite CI/CD platform, like GitHub Actions.
Unfortunately,it's still not supported on Mac as we'd have to add a bunch of DLLs which increases the size of the package and the tradeoff for such a small target audience doesn't seem big enough.
In addition, we've updated a bunch of other commands and made them work with Linux and OS X too. It was mostly path and decryption issues.
Three of our SSIS commands, Copy-DbaSsisCatalog
, New-DbaSsisCatalog
and Get-DbaSsisEnvironmentVariable
have been removed. They've always been problematic and with the newest update, they've just stopped functioning.
We're considering moving them to a new module dbatools.ssis
but we're waiting to see if new versions of SMO will work more reliability.
The replication commands continue to work if SSMS is installed, so we've kept them in.
We've introduced 3 new firewall commands, New-DbaFirewallRule
, Get-DbaFirewallRule
, and `Remove-DbaFirewallRule have been added to dbatools. Huge shoutout to @andreasjordan for making that happen.
These commands make it super easy to add new firewall rules to allow connections to SQL Server components.
New-DbaFirewallRule -SqlInstance SRV1, SRV1\TEST
In the above example, New-DbaFirewallRule
automatically configures the needed firewall rules for both the default instance and the instance named TEST on SRV1
If your databases have non-default or complex file structures, we've made it even easier to perform restores.
Now,you can easily use the file structure from one server as the mapping for a database restore on another server by using Get-DbaDbFileMapping
.
$filemap = Get-DbaDbFileMapping -SqlInstance sql2016 -Database test
Get-ChildItem \\nas\backups\db\test | Restore-DbaDatabase -SqlInstance sql2019 -Database test -FileMapping $filemap.FileMapping
If you encrypt your network connections, Test-DbaComputerCertificateExpiration
, can make it easy to check for certificates that are expiring soon.
Test-DbaComputerCertificateExpiration -ComputerName sql2016 -Threshold 90
This command will also check other types of certs, so you can use it as a general purpose cert expiration checker if you'd like.
If you work with Connection Strings a lot, be aware that some of the connstrings that Microsoft.Data.SqlClient
generates are incompatible with good ol' System.Data.SqlClient
.
If you use dbatools to generate connection strings, you can use the -Legacy
switch to output System.Data compatible connection strings.
New-DbaConnectionString -SqlInstance sql2012 -Database pubs -Legacy
We've created a new command that gives detailed information about dbatools-related errors. It gives the stack trace and everything.
We also fixed a ton of bugs and are now down to less than 10 🔥🚒
Up next, we're fixing dbatools.io. Sorry it's in shambles and the commands page is so outdated. docs.dbatools.io is still lookin fab (thanks @niphlod!)
New-Command - Get-DbatoolsError by @potatoqualitee
Connect-DbaInstance - Side-step Token usage on Core by @potatoqualitee
Publish-DbaDacPackage -- add Linux support by @potatoqualitee
Get-DbaBackupInformation - Add Size to FileList by @potatoqualitee
Set-DbaDbState - continue if KillAllProcesses fails due to limited permissions by @potatoqualitee
Connect-DbaInstance - Catch when Windows creds are attempted on Linux/mac host by @potatoqualitee
Watch-DbaXESession / Read-DbaXEFile / Read-DbaAuditFile - Add Linux support by @potatoqualitee
XPlat Solution for reading XEL by @potatoqualitee
New-Command - Get-DbaInstalledPatch by @potatoqualitee
More Linux Compatability by @potatoqualitee
Set-DbaAgentJobOwner - Only attempt to change Local job types by @potatoqualitee
Remove-DbaAgDatabase - Fix examples by @potatoqualitee
Get/Test-DbaManagementObject - Fix for new Windows path, Make Get Linux compat by @potatoqualitee
Write-DbaDbTableData - Parse for Database so that it doesn't have to be respecified by @potatoqualitee
Connect-DbaInstance - Add back Microsoft.Identity.Client support by @potatoqualitee
Add more Linux support by @potatoqualitee
Get-DbaDbBackupHistory - Avoid a .ToString() that pollutes $error by @potatoqualitee
Import-DbaXESessionTemplate - Add StartUpState Parameter by @potatoqualitee
Sign dbatools DLLs by @potatoqualitee
Backup/Restore Suite - Recursefix by @Stuart-Moore
SSIS and Replication Commands -- Remove SSIS Commands, Update SMO/Library Import and Messages by @potatoqualitee
New command - Get-DbaDbFileMapping by @potatoqualitee
Delete StructuredLogger.dll by @potatoqualitee
New Commands: New-/Get-/Remove-DbaFirewallRule by @andreasjordan
New-DbaAvailabilityGroup - Refresh AvailabilityGroup information in SMO after join by @andreasjordan
Fixes Ignoring Value of -Verbose/-Debug by @JPRuskin
New commands: Get/Stop-DbaExternalProcess by @potatoqualitee
New Command: Test-DbaComputerCertificateExpiration by @potatoqualitee
Appveyor/retry failing by @niphlod
Invoke-DbaQuery, added regr tests and TVP examples by @niphlod
Restore-DbaDatabase - Fix SMO refresh by @andreasjordan
New-DbaDatabase - Add ability to change file names by @potatoqualitee
Invoke-DbaQuery - Accept Microsoft.Data.SqlClient.SqlParameter for SqlParameter by @potatoqualitee
Install-DbaInstance - Don't add domain to a local host by @andreasjordan
Invoke-DbaQuery - Add explicit position to SqlInstance by @potatoqualitee
Invoke-DbaDbDataGenerator - Use Min and Max with Get-DbaRandomizedValue by @andreasjordan
Copy-DbaXESession - Add connection to try catch by @potatoqualitee
Convert-ConnectionString - remove old code syntax by @potatoqualitee
Get-DbaAgentJob - filter startdate for Get-DbaRunningJob by @potatoqualitee
More tests and bug fixes by @potatoqualitee
New-DbaConnectionString - Update for Microsoft.Data.SqlClient by @potatoqualitee
Cleanup library import by @potatoqualitee
Reset-DbaAdmin - Fix Invoke-ResetSqlCmd to use EnableException by @andreasjordan
Fix SQL Auth issues by @potatoqualitee
Remove extra dbatools.dll file by @potatoqualitee
Invoke-DbaBalanceDataFiles bugfix - use connected $server instead of $instance by @potatoqualitee
Add more GH Actions Tests for Linux by @potatoqualitee
Connect-DbaInstance - Reorder changes when connection context is copied by @andreasjordan
Major change: Update SMO, update dbatools library, and switch System.Data to Microsoft.Data by @potatoqualitee
Connect-DbaInstance - Set the new code path as default by @andreasjordan
New internal command Resolve-DbaComputerName that uses Resolve-DbaNetworkName to replace Resolve-NetBiosName by @andreasjordan
Copy-DbaDatabase - Fill *NetBios with FullComputerName by @andreasjordan
Published by potatoqualitee over 3 years ago
dbatools-buildref-index.json - Fix KB for 14.0.3037 (SQL Server 2017 CU10) by @andreasjordan
Added SQL 2017 CU25 by @MikeyBronowski
Reset-DbaAdmin - Use Resolve-DbaNetworkName to get ipaddress and hostname by @andreasjordan
Save-DbaKbUpdate - Using Architecture and some other fixes by @andreasjordan
Convert issue templates to Issue Forms (beta) by @wsmelton
New/Set-DbaAgentSchedule - Fix usage of FrequencyInterval for daily interval by @andreasjordan
This is also in v1.0.172 but the build process timed out and didn't update releases
Published by potatoqualitee over 3 years ago
Connect-DbaInstance - Optimize code for StatementTimeout and ApplicationIntent by @andreasjordan
Copy-DbaLogin - Update docs to be more accurate by @potatoqualitee
Fix multiple commands to restore compatibility for PSv3 - remove unsupported method ::new(
by @potatoqualitee
Connect-DbaInstance - Test for GUID username when using Tenant by @potatoqualitee
Set-DbaPrivilege - Don't write a warning if privilege is already set by @andreasjordan
Get-DbaRunningJob - add StartDate property by @wsmelton
Published by potatoqualitee over 3 years ago
Published by potatoqualitee over 3 years ago
Remove-DbaDbSequence - fix test by @potatoqualitee
Get-DbaRandomizedValue - Generate bigint values by @ClaudioESSilva
logfilescript.ps1 - Better pipeline processing to prevent 4100 errors in Windows Event Log by @andreasjordan
*-DbaDbOrphanUser - Improve the workflow and fix some bugs by @andreasjordan
New function : Remove-DbaDbView by @MikeyBronowski
Published by potatoqualitee over 3 years ago
Add-DbaAgDatabase - Fix step 4 (JoinAvailablityGroup) for versions 2012 and 2014 by @andreasjordan
Add GitHub Tests to perform docker migration and mirroring from Linux runner by @potatoqualitee
Rename-DbaLogin - Check if user exists before attempting to rename it, require Force to rename db users too by @potatoqualitee
Get- / Test- / Set-DbaPowerPlan - Complete redesign to reduce duplicate code by @andreasjordan
New commands - Get-DbaDbFileGrowth and Set-DbaDbFileGrowth by @potatoqualitee
Connect-DbaInstance / new code path - General improvements by @andreasjordan
Published by potatoqualitee over 3 years ago
Published by potatoqualitee over 3 years ago
Add-DbaAgDatabase - Add missing SqlCredential when calling Test-DbaAvailabilityGroup by @andreasjordan
Get-ObjectNameParts - Fix for parsing object name with empty schema by @andreasjordan
Write-DbaDbTableData - Be able to work with temp tables by @andreasjordan
Repair-DbaInstanceName - Corrected test for warnings from Test-DbaInstanceName by @andreasjordan
Published by potatoqualitee over 3 years ago
Published by potatoqualitee over 3 years ago
Get-DbaDbMirror - Add new parameter for Database filtering by @potatoqualitee
Copy-DbaLinkedServer - New parameter to exclude copying sensitive info by @potatoqualitee
Start-DbaMigration - Fix WhatIf output by @potatoqualitee
Write-DbaDbTableData - Don't continue in end block if an earlier error is encountered by @potatoqualitee
Published by potatoqualitee over 3 years ago
Published by potatoqualitee over 3 years ago