Skip to content

Instantly share code, notes, and snippets.

View gbargsley's full-sized avatar

Garry Bargsley gbargsley

View GitHub Profile
@wsmelton
wsmelton / copy-dbalogin-parameters.md
Last active July 21, 2021 20:12
A look into the parameters of Copy-DbaLogin

SQL Server migrations, the bain in most DBA's lives when they find out one is coming up. At that top of the list, along with finding out, you need to test your database DR strategy that is fully documented 😉 😉.

Still, one of the most common tasks that can be in day-to-day activity is getting logins created between various SQL Server instances. Say you have to support multiple environments for a given application database, creating that login 3, 4, 5 different times manually using SSMS 😧! dbatools includes a ton of commands that help in migrations.

Do you have multiple Availability Groups (AG) deployed in your environment? AGs that have 3, 4, 6 replicas that you are adding a login to one require adding it to all the other replicas?

These scenarios, among many others, are where Copy-DbaLogin can help make your life easier and give you more time to catch up on other things.

Copy-DbaLogin

@SQLvariant
SQLvariant / Mmmm_Chocolatey.ps1
Last active September 9, 2023 12:15
Install SQL / Data Developer Desktop Tools from Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install chocolatey -y
choco install sql-server-management-studio -y
choco install azure-data-studio -y
choco install azuredatastudio-powershell -y
choco install git.install -y
choco install vscode -y
choco install vscode-powershell -y
choco install powerbi -y
@pcgeek86
pcgeek86 / cheatsheet.ps1
Last active May 15, 2024 02:07
PowerShell Cheat Sheet / Quick Reference
Get-Command # Retrieves a list of all the commands available to PowerShell
# (native binaries in $env:PATH + cmdlets / functions from PowerShell modules)
Get-Command -Module Microsoft* # Retrieves a list of all the PowerShell commands exported from modules named Microsoft*
Get-Command -Name *item # Retrieves a list of all commands (native binaries + PowerShell commands) ending in "item"
Get-Help # Get all help topics
Get-Help -Name about_Variables # Get help for a specific about_* topic (aka. man page)
Get-Help -Name Get-Command # Get help for a specific PowerShell function
Get-Help -Name Get-Command -Parameter Module # Get help for a specific parameter on a specific command