Today’s blog post is part of T-SQL Tuesday. T-SQL Tuesday is the brainchild of Adam Machanic. It is a monthly blog party on the second Tuesday of each month. Everyone is welcome to participate. This month’s T-SQL Tuesday, hosted by…
In a recent version of PowerShell, Publish-Module, which publishes modules to the Gallery began requiring fully qualified Assembly names such as “Microsoft.SqlServer.Smo, Version=$smoversion, Culture=neutral, PublicKeyToken=89845dcd8080cc91”. Previously, it was sufficient just to use short names such as Microsoft.SqlServer.Smo. This had similar…
We’re currently working on standardizing our documentation for dbatools and I needed a list of all of the parameters we use. Here’s how I did it (well, I did it an uglier way then Aaron made it prettier ;)) Get-Command…
Today’s blog post is part of T-SQL Tuesday. T-SQL Tuesday is the brainchild of Adam Machanic. It is a monthly blog party on the second Tuesday of each month. Everyone is welcome to participate. intro dbatools has been around since…
One of my favorite things in PowerShell (and other languages) is the switch statement. It’s clean and a much better alternative to a ton of if elses. Ever had this happen?
if ($state -eq -1)
$diskstate = "Unknown"
elseif ($state -eq 0)
$diskstate = "Inherited"
elseif ($state -eq 1)
$diskstate = "Initializing"
elseif ($state -eq 2)
$diskstate = "Online"
The better way to do it is by…
In my previous post, I presented the template I use anytime I need to add multithreading to my scripts. Recently, I had a request to add multi-threading to Read-DbaBackupHeader. This was the first runspace in which I had to output…
Last year, I was looking into multi-threading in PowerShell and, with the help of Dr. Tobias Weltner, Boe Prox and Martin Pugh ultimately decided on runspaces. Then, I presented at psconf.eu about using runspaces to speed up SQL Server/CSV imports.…
Repost from dbatools.io: Recently, I presented to the Philadelphia PowerShell User Group about Contributing to Open Source PowerShell projects using GitHub Desktop. I chose this topic because a number of people have asked for step-by-step instructions on how to work…