Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Function to install dbatools PowerShell Module
function Install-dbatools {
Import-Module dbatools -ErrorAction SilentlyContinue
if((Get-Module | Where-Object {$_.Name -eq "dbatools"}) -eq $null) {
Write-Output "dbatools module installing"
Install-Module dbatools -force
else {
Write-Output "dbatools module already installed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.