powershell

It turns out I was doing this all wrong for months. For the longest time, I’ve been checking my SQL Server instances to see what needs patching with Test-DbaBuild from the dbatools PowerShell module. But the result was always the same – it never returned a Service Pack or Cumulative Update target. I glossed over…

Read More Checking for SQL Server Updates with dbatools

I was recently working on a PowerShell script to set up some new databases for my users and found myself writing the same things over and over again. By the 4th Invoke-DbaQuery, I found myself thinking “this repetitive typing kind of sucks.” Then I remembered Chrissy LeMaire’s segment in the first PSPowerHour where she talked…

Read More Tidier Powershell Scripts with Default Parameter Values

A bit over a year ago, I blogged about my experience migrating a test SQL Server instance from a VM to a physical machine with a little help from my friends. That migration went well and the instance has been running trouble-free ever since. But it’s small potatoes. A modest instance, it’s only about 5%…

Read More A Monumental Migration to SQL Server 2016 – Part 1

In my previous post, I mentioned that I wasn’t checking the status of my RSJobs because I had logging built into my function. I originally tried to log out to plain text files with Out-File, but quickly hit a wall. In a multi-threaded script, attempting to write to the same text file from multiple threads…

Read More Thread-safe PowerShell Logging with PSFramework