Notices: This section not yet converted to new layout. Download stats are rolling back out.

dbatools (PowerShell Module)

1.0.22

Package test results are passing.

This package was approved as a trusted package on 7/16/2019.

dbatools is sort of like a command-line SQL Server Management Studio. The project initially started out as Start-SqlMigration.ps1, but has now grown into a collection of over 300 commands that help automate SQL Server tasks and encourage best practices.

NOTE: This module requires a minimum of PowerShell v3.

NOTE: This is an automatically updated package. If you find it is out of date by more than a week, please contact the maintainer(s) and let them know the package is no longer updating correctly.

To install dbatools (PowerShell Module), run the following command from the command line or from PowerShell:

C:\> choco install dbatools

To upgrade dbatools (PowerShell Module), run the following command from the command line or from PowerShell:

C:\> choco upgrade dbatools

Files

Hide
  • tools\.skipAutoUninstaller
  • tools\chocolateyBeforeModify.ps1 Show
    $ErrorActionPreference = 'Stop'
    
    $moduleName = 'dbatools'      # this could be different from package name
    
    $module = Get-Module -Name $moduleName
    if ($module) {
        Write-Verbose "Module '$moduleName' is imported into the session. Removing it."
        Remove-Module -Name $moduleName -Force -ErrorAction SilentlyContinue
    
        if ($lib = [appdomain]::CurrentDomain.GetAssemblies() | Where-Object FullName -like "dbatools, *") {
            Write-Verbose "Found locked DLL files for module '$moduleName'."
            $moduleDir = Split-Path $module.Path -Parent
            if ($lib.Location -like "$moduleDir\*") {
                Write-Warning @"
    We have detected dbatools to be already imported from '$moduleDir' and the dll files have been locked and cannot be updated.
    Please close all consoles that have dbatools imported (Remove-Module dbatools is NOT enough).
    "@
                throw 
            }
        }
    }
  • tools\chocolateyInstall.ps1 Show
    $ErrorActionPreference = 'Stop'
    
    $toolsDir   = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
    $moduleName = 'dbatools'  # this may be different from the package name and different case
    
    if ($PSVersionTable.PSVersion.Major -lt 3) {
        throw "$moduleName) module requires a minimum of PowerShell v3."
    }
    
    # module may already be installed outside of Chocolatey
    Remove-Module -Name $moduleName -Force -ErrorAction SilentlyContinue
    
    $sourcePath = Join-Path -Path $toolsDir -ChildPath "$modulename.zip"
    $destPath   = Join-Path -Path $env:ProgramFiles -ChildPath "WindowsPowerShell\Modules\$moduleName"
    
    if ($PSVersionTable.PSVersion.Major -ge 5)
    {
        $destPath     = Join-Path -Path $destPath -ChildPath $env:ChocolateyPackageVersion
    }
    
    Write-Verbose "Creating destination directory '$destPath' for module."
    New-Item -Path $destPath -ItemType Directory -Force -ErrorAction SilentlyContinue | Out-Null
    
    Write-Verbose "Extracting '$moduleName' files from '$sourcePath' to '$destPath'."
    Get-ChocolateyUnzip -FileFullPath $sourcePath -Destination $destPath
    
    if ($PSVersionTable.PSVersion.Major -lt 4)
    {
        $modulePaths = [Environment]::GetEnvironmentVariable('PSModulePath', 'Machine') -split ';'
        if ($modulePaths -notcontains $destPath)
        {
            Write-Verbose "Adding '$destPath' to PSModulePath."
            $newModulePath = @($destPath, $modulePaths) -join ';'
    
            [Environment]::SetEnvironmentVariable('PSModulePath', $newModulePath, 'Machine')
            $env:PSModulePath = $newModulePath
        }
    }
  • tools\chocolateyUninstall.ps1 Show
    $ErrorActionPreference = 'Stop'
    
    $moduleName = 'dbatools'
    $sourcePath = Join-Path -Path $env:ProgramFiles -ChildPath "WindowsPowerShell\Modules\$moduleName"
    
    Write-Verbose "Removing all version of '$moduleName' from '$sourcePath'."
    Remove-Item -Path $sourcePath -Recurse -Force -ErrorAction SilentlyContinue
    
    if ($PSVersionTable.PSVersion.Major -lt 4) {
        $modulePaths = [Environment]::GetEnvironmentVariable('PSModulePath', 'Machine') -split ';'
    
        Write-Verbose "Removing '$sourcePath' from PSModulePath."
        $newModulePath = $modulePaths | Where-Object { $_ -ne $sourcePath }
    
        [Environment]::SetEnvironmentVariable('PSModulePath', $newModulePath, 'Machine')
        $env:PSModulePath = $newModulePath
    }
  • tools\dbatools.zip Show
    md5: 3B4F91D1EED6598FF9C4725B3952330B | sha1: EA792781E38390E00C7A8911103E34346220184B | sha256: 90A497E52EA95D29B7F89708522A2D7E183E1AF459868EE0CD62D7D7657319B5 | sha512: 18FCEFDEC627E5CC18E658B4594B1BAF15E319017F6B8318C569208257714A8F7452691FD1840AE5E6437E81F6AF422F2CBF61F82AA9E549D130AAD59889E55B
  • tools\LICENSE.txt Show
    From: https://raw.githubusercontent.com/sqlcollaborative/dbatools/master/LICENSE
    
    LICENSE
    
    MIT License
    
    Copyright (c) 2018 Chrissy LeMaire
    
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:
    
    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.
    
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.
  • tools\VERIFICATION.txt Show
    VERIFICATION
    Verification is intended to assist the Chocolatey moderators and community in verifying that this package's contents are trustworthy.
    
    To verify the files using the project source:
    
    1. Please go to the project source location (https://github.com/sqlcollaborative/dbatools) and download the source files;
    2. Build the source to create the binary files to verify;
    3. Use Get-FileHash -Path <FILE TO VERIFY> to get the file hash value from both the built file (from step 1 above) and the file from the dbatools.zip within the package and compare them;
    
    Alternatively you can download the module from the PowerShell Gallery ...
    
        Save-Module -Name dbatools -Path <PATH TO DOWNLOAD TO>
    
    ... and compare the files from the package against those in the installed module. Again use Get-FileHash -Path <FILE TO VERIFY> to retrieve those hash values.

Virus Scan Results

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Dependencies

This package has no dependencies.

Package Maintainer(s)

Software Author(s)

  • Chrissy LeMaire

Copyright

2018 Chrissy LeMaire

Tags

Release Notes

https://github.com/sqlcollaborative/dbatools/releases

Version History

Version Downloads Last updated Status
dbatools (PowerShell Module) 1.0.21 85 Friday, July 12, 2019 approved
dbatools (PowerShell Module) 1.0.20 70 Wednesday, July 10, 2019 approved
dbatools (PowerShell Module) 1.0.19 38 Wednesday, July 10, 2019 approved
dbatools (PowerShell Module) 1.0.17 46 Tuesday, July 9, 2019 approved
dbatools (PowerShell Module) 1.0.15 59 Saturday, July 6, 2019 approved
dbatools (PowerShell Module) 1.0.14 30 Friday, July 5, 2019 approved
dbatools (PowerShell Module) 1.0.13 13 Thursday, July 4, 2019 approved
dbatools (PowerShell Module) 1.0.12 65 Tuesday, July 2, 2019 approved
dbatools (PowerShell Module) 1.0.11 29 Monday, July 1, 2019 approved
Show More

Discussion for the dbatools (PowerShell Module) Package

Ground rules:

  • This discussion is only about dbatools (PowerShell Module) and the dbatools (PowerShell Module) package. If you have feedback for Chocolatey, please contact the google group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or dbatools (PowerShell Module), or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.

comments powered by Disqus
Chocolatey.org uses cookies to enhance the user experience of the site.
Ok