Class of 2019: 25 Microsoft MVPs you should be following

Back in 1996, as I watched a movie about Italy at the Drexel Theatre in Columbus OH, I decided that one day I’d live in Europe.

I didn’t need to move immediately. I just put it on my long-term agenda and figured things would eventually work themselves out with gentle guidance.

Part of that gentle guidance was to casually look for jobs in the UK and Europe 😅 I noticed that a lot of the coolest jobs were offered by the Microsoft-centric recruitment company, Nigel Frank.

I ended up working for another company that had jobs in both America and the EU, but still follow Nigel Frank with the cool jobs to see what skills I need to stay relevant.

Considering this familiarity with Nigel Frank, I was incredibly blown away that they listed me as one of the Top 25 Microsoft MVPs you should be following in 2019. What an honor! I am included with a number of my highly regarded colleagues including Jaap Brasser, Sarah Dutkiewicz, Thomas Poppelgaard, and Paul Andrew.

In 2019, my primary focus will remain on dbatools, though I’m also throwing in a bit of effort into kbupdate and SPReplicator. I’m also continuing to work on dbatools in a month of lunches with Rob Sewell for Manning Publications. Looks like the MEAP will be coming out soon! Stay tuned for more info.

Posted in General

My Current Livestream Setup

Back in January and February, I wrote couple posts that highlighted my journey into livestreaming, from understanding the different services/platforms to the lighting I used.

Since then, I got pretty deep into the hardware part but actually returned to a simplified setup. The third iteration was pretty intense. I even purchased a professional grade microphone and a green screen.

Retired hardware

Before I go into what I’m currently using, let’s look at what I’ve retired since March.

The Yeti Mic is only semi-retired. It’s really high-quality and easy-to-use but it’s kinda in my way and the Bose wireless headphones work well enough. I use the Yeti when I get tired of wearing my headphones.

The green screen was cool af and allowed me to be superimposed on top of my screen, which you can see here on YouTube.

I no longer use it, though, because the setup is not worth the thrill for me. It was nice, but now I just light up my office with some cool blues and purples and go about my day.

I actually never used the floodlights because they were SO POWERFUL that they almost blinded me and Potato. I gave them away but now kinda wish that I still had them because I’d like to use them to make my office bright blue and purple. Before, I was trying to use them to highlight my green screen but it turned out I didn’t need it.

Now in use

Here are the things I do still use

The Bose SoundLinks are not noise cancelling which is why I like them. Noise cancelling headphones create a pressure in my ear that make them unpleasant to use. But these are so comfortable and sound so good, I bought a pair for my wife as well.

I never had time to get into the Elgato Stream Deck, but what I have programmed is super useful and I rely on it every stream. Their Key Light is also awesome and casts a soft light that looks pleasant on screen.

Livestream blue and purple

Seems like every livestreamer has these cool blues and purples in the background. I knew I’d be going away from the green screen but wanted a fun background so I got a few LED light packs.

The Luminoodles backlight my monitors. I LOVE it! But mostly it’s just me that sees it. In the back, though, are the two string light sets. The purple ones I bought are pretty weak but the ZAECANY blues are so bright!

Here’s what it looked like the first time I saw myself in Livestreamer colors.

And here’s what it looks like when I’m coding. This will likely be how my livestream looks from now on.

If you’re wondering about my VS Code theme, that’d be the best theme ever, Cold Snack.

Software changes

I haven’t changed too much, except that I switched my live captioning from pubnub to Stream Closed Captioner by talk2megooseman. Gooseman’s closed caption streamer is Twitch native and can be turned off and on.


Oh, and I also made my own overlay! Straight-up from scratch using Paint.NET.

This is how I placed the above overlay in OBS. Super easy.

Starting Soon and Pause screens

I also updated my starting soon and pause screens. I’ve replaced the VHS 80’s theme with something that provides more information for people popping by.


I’ve been doing some livestreaming from my phone at conferences, too! At, I did a session with Tyler Leonhardt and Chris Gardner about livestreaming.

This isn’t the official conference video, it was just streamed from my phone so please bear with the quality ;)

We also streamed the launch of dbatools 1.0 from the breakfast room at DataGrillen!

In case you’re wondering, those were both streamed from my iPhone. One over conference wifi and one over a 3G connection.

If you’d like to see all of my previous livestreams, I keep an archive at

Livestreaming IP Cams

When I want to livestream my cats, I use the VLC Source and RTSP in OBS. It’s not super stable but generally works for several hours. Here’s a random tutorial I found. Can’t recall the one I used.

My Elgato Stream Deck interface

Haven’t made many changes because this setup works for me 😁

The deck is super useful for automation. Even if you aren’t into livestreaming, you can still automate things like dev/test refreshes with the press of a button.

Maybe I’ll ask for one at work 🤔

Posted in Livestreaming

My Second Twitch Livestream Setup

Back in January, I wrote an introduction to livestreaming titled My First Twitch Livestream Setup. In it, I created the how-to guide for getting started that I wish I had the day I found Twitch.

It’s now been a couple weeks and I’m becoming more acclimated to Twitch, though I still don’t get emotes and would prefer if Slack-style :emojis: were still in style 😅 Oh, and in addition to PowerShellLive, I’m now a member of Live Coders! Thanks so much to Jeff Fritz for the invite 🌈

In this post, I’ll outline what I’ve figured out since writing the first post. If you’re new to Twitch, I’d suggest first reading My First Twitch Livestream Setup, doing a few streams that way, then returning to this post. All of it at once can be overwhelming, even if you’ve been doing computers your whole life.

  • Interacting with people
  • Streaming Services
  • Prettier profile
  • Music
  • Secondary camera
  • Stream Deck
  • Lights
  • What I still don’t know

Interacting with people

Twitch is awesome because it lets you “interact with the TV”. As a viewer, I’ll sometimes give a follow to see the delight on the streamer’s face or because I want to interact with them.

But as a streamer, if you don’t explicitly set things up, you can’t really see if someone followed you or if someone subscribed to your channel.

I felt bad that people were giving me follows and I couldn’t thank them, that I mentioned it during one of my streams. Microsoft’s Tyler Leonhardt of the PowerShell team was kind enough to let me know in chat when someone followed (I still don’t know how he figured that out.)

I was extra excited when I finally figured out how to create that alert. So pumped, in fact, I did a dance and posted it on Twitter:

It wasn’t hard at all, I just needed to find the time to do it. So how’d I do it? I used a free streaming service and basically just pasted a web address into OBS.

Streaming services

Streaming services provide all sorts of add-ons to your stream, including Alerts like the one above. There are a few competing streaming services, and I’m finding myself using a mix of them. Three popular ones include:


One day during one of my livestreams, I was lamenting about how I couldn’t use Streamlabs because I had a Mac and Microsoft livestreamer Jeff Fritz (csharpfritz) told me that I still could! I just can’t use their beautiful OBS wrapper which currently only works on Windows, but I can use their streaming service.

Within just a few minutes of setting up Streamlabs, I had all of my alerts! It was as easy as:

  • Login to StreamLabs using your Twitch account
  • In the Dashboard, click AlertBox in your sidebar navigation
  • Copy the URL
  • Paste the URL into OBS as a Browser Source

Much easier than I expected 👍 By default, there is a running zombie for new followers. It’s cute, but I like Yoshi more so I selected him from gifs included in their gallery. You can also upload your own gifs, but that’s for later.


StreamElements offers a lot of the same things as StreamLabs, like Alerts. It also offers overlays which is the border surrounding people’s stream that gives their social information, etc. Here’s what fellow PowerShell streamer VeronicaGeek’s overlay looks like.

Veronica was the one who told me about StreamElements after I asked how she did her overlay. I still haven’t entirely figured out the overlay thing so that’ll be included in my Third Twitch Livestream Setup.

I have not used muxy so I don’t have anything to report about that yet.

Prettier profile

I also stopped borrowing someone else’s Panel pics and made my own at 👍 It’s ultra easy. Here, I’ll do one right now for the blog.

Tyler took it a step further and paid someone to do his (I think). His profile is so good! Love the posh-git theme.


I’ve changed my position on music, too. Mostly. I’m still not a big fan of pretzel, but I do enjoy streams like Jeff Fritz’s that use coder-centric music services.

These are playlists and sounds designed to be unobtrusive background melodies that get you in the zone. I also love lofi hip hop radio – beats to relax/study to but in my test stream, out of like 20 hours, 6 minutes did get muted.

Anyway, if you don’t care about getting muted in the video playback (live never/rarely gets muted), letting your viewers rock along with you is a lot of fun.

Secondary camera

I ended up adding a secondary camera to my stream, too. I had a Nest Cam laying around and added a Cat cam to my stream! It’s super cute.

They even have their own dedicated account, now. Check out this clip, which is a short highlight video, of Kitty and Potato.

The Nest Cam is an IP camera and I added it to OBS by following this tutorial on YouTube.

The awesomest

By far, the best addition to my Twitch stream has been the Elgato Stream Deck. This thing is SO FUN! It’s a macro automation keyboard that’s so well-made. Elgato seems to be like the Mercedes Benz of Streaming equipment. They also sell a gorgeous light called the Key Light and an elegant green screen.

You don’t need a Stream Deck to be a streamer, and you don’t need to stream to have a Stream Deck! After I posted a picture of some of the keys I’d done, my buddy Lee bought one just to make automation easier. My deck setup is still unfinished, but here’s the progress I’ve made.

The button in the middle starts PowerShell on my Mac and imports dbatools 😎 The row at the top helps me go between scenes real quick. And the steps are so easy! Check out my “Starting soon” button configuration:

It even changes my Twitter name and tweets for me! The configuration is drag and drop, too. If you want to extend it, that is also possible. I’m obsessed with this stream deck so I’ll probably write a follow-up intro article at some point.


Good lighting makes a huge difference! I turned on the lamp on the side of my desk and it was awful, like when you accidentally open the front facing camera.

Fortunately, I had a Happy Light laying around and it turned out to be perfect! You can’t even tell I have forehead wrinkles now, as can be seen in this reduced-quality Twitter video where I talk about the first time I met Jeffrey Snover.

Not saying that you gotta get a Happy Light, but if you’ve got one, it works well. There are lights dedicated to this, including the Elegato light, and also, a lot of people use webcams that have this soft light built-in, like the one Jeff Fritz mentions in his post Live Streaming Setup – 2019 Edition, the Razer Kiyo camera.

What I still don’t know

I don’t totally understand subscriptions, loot, cheers and all that. It looks like people give and get real money, but that seems outlandish 😅

I also want to learn more about bots, bot mods and emotes. Some emotes, I just don’t know what they mean. Like, what the hell is a pog champ?

Posted in Livestreaming, PowerShell

dark mode is for lovers 🖤

This post is about all the things I use to fill my life with dark mode. I’m mostly writing to tell everyone about a free browser plugin, Dark Reader, that’s incredible, but will include other extras as well.

Dark Reader

The browser plugin Dark Reader has changed my life and I’m obsessed with it. As I explained to a friend “I have the best plugin in the world to recommend. It automatically dark themes every website by detecting color schemes and then rewrites a matching dark theme dynamically”

It works on sites with complex code themes too! But I don’t know if you missed it in the first screenshot, you can control the brightness! The contrast! The SEPIA! What?

Dark Reader is free for Chrome, Firefox and indirectly on Opera. For Safari, it costs $4.99. I ended up donating $5 and will probably donate regularly. I’m so shocked at how great this plugin is.


HazeOver is a “distraction dimmer” for Mac. I originally got it to help fix the dumbest issue ever: Mac brightness controls don’t control the secondary monitor(?!) So I got HazeOver to dim my secondary monitor but it turned out to be awesome in general. It dims whatever windows aren’t active and it’s damn smooth about it.


It costs $9.99 but you can do a free trial. I decided to give give them my money after seeing all of the incredibly glowing reviews. Now I’m one of those reviewers being like “best app ever!”

Dark Mode Script for Slack

Adil Leghari created this awesome PowerShell script to dark mode Slack.


Slack is outrageous and I’ve given up on them supporting dark mode. It’s literally been 5 years since they started saying it was on their radar 🙄

Windows and mac OS

In better news, both Microsoft and Apple delivered on dark modes! Windows 10 October 2018 update now supports dark mode! And, of course, mac OS Mojave is downright gorgeous.


For dark mode irl, check out Luminoodle TV Bias Lighting. The back of my monitors point at the wall and it creates such a nice glow that super easy on the eyes 😍

If anyone has some dark themers that they are pumped about, let me know in the comments!

Posted in General

My First Twitch Livestream Setup

Back in December, I found Twitch and fell in love with livestreaming. It was amazing watching people code in PowerShell with blinged out profiles and cool cut screens. Whaaat, this is a thing? I love it!

Getting started

I jumped into streaming (I’m potatoqualitee on Twitch) as soon as I found the PowerShell Live Twitch group on Twitter, and discovered the learning curve was a bit steep.

This post is aims to address the things that were confusing for me when I was starting out as well as my current setup.

  • Quick intro
  • Streaming Hardware
  • Streaming Software
  • Stream Settings
  • Twitch Settings

So first, a bit of the human side: I tested in a non-live stream to see what it’d be like to code in front of an audience. Would I make weird faces and say dumb stuff? Turns out, yes, but my friends enjoyed it so I put it on YouTube for the public and got a warm reception 🤗

Next up, it was time to stream for real! I had a blast. A whole bunch of PowerShell friends from Twitter joined and this is what it looked like.

Next video will have the chat box on that right side. Sorry, lesson learned 😖

So now onto the guide for you based on my past month of learning.

Overall idea

The overall idea of streaming is this: you create an account with Twitch, get your streaming key, plug it into your streaming software, do some additional configurations, then hit Start Streaming. From there, you’ll be streaming, and whoever wants to join your channel can see you stream, albeit after a slight delay (which you can control with latency settings).

Streaming platform

The two most common streaming platforms appear to be Amazon’s Twitch and Google’s YouTube. Most of the PowerShellers I know are streaming on Twitch, though PowerShell Security expert Carlos Perez just started on YouTube. This guide will only address Twitch because that’s what I use.

Streaming software

In order to livestream, you’ll need some streaming software. OBS is free and the most popular, and even advanced streamers who can afford paid software use it. Twitch and YouTube have minimal guides, but my favorite guide is Top 10 Best Twitch Streaming Software Options written by Bill R in October 2018.

A nice lil profile

You can also bling your channel, and a lot of people do. This is what my channel looks like today.



I am so relieved I just upgraded my desktop because it seems streaming requires decently hefty hardware. This section won’t be super interesting, admittedly. I love software development and like my hardware simplified.

My headset is worth a separate mention. The mic is exceptional for a headset; I was recently told during a meeting that it sounded as though I was sitting next to the person. I’ve had this pair for years, the bass is great and love it.

Even better, the Sades SA903 7.1 Surround Sound USB PC Stereo Gaming Headset is only $29.99 on Amazon.

I tried a cheaper $20 version for a backup, but I much preferred the SA903. So now I have this leet black and red set on the way 🎧 For Windows users, the driver issue is weird. Sander Stad got a pair and said the drivers aren’t on the vendor website. You can download them here.

If you find that you are streaming regularly and want to invest in a higher-end setup, check out Jeff Fritz’s post Live Streaming Setup – 2019 Edition.

Also if you get super into streaming, you can get a Stream Deck which is a physical controller with a bunch of macros on it. People even do green screens too, which is covered in Jeff’s post. Maybe I’ll get that for my birthday, but no need for it just yet.

Streaming Software

I chose the Open Broadcast Software, otherwise known as OBS, to broadcast my streams. At first, I was so frustrated with it, I decided I’d pay for one that was easier to use, but then it turns out none of them supported mac OS 👎. So back to OBS.

Happy that it turned out that way, tho! Now that I know how to use it, it’s perfectly suitable.

I won’t go over OBS in-depth, I’ll just cover the things I found challenging, mostly because it’s a whole new world and I didn’t know where to find things or what words to use when searching.

Update: I recently received a message from fellow streamer Shawn Melton who said

OH MY GOODNESS….streamlabs is so flippy easy to setup compared to OBS. It even prompts you on some starting widgets to add to your stream and walks you through each section

I heard great things about StreamLabs but could not try it out because it’s not Mac compatible. If you’re interested, give it a go. It’s based off of OBS so the rest of the guide will likely apply a lot.

Pause screen

First, you’ll notice that a lot of people are like “k, gotta cover my screen while i log into my vpn, be back in 5”, then a cool lil cut screen comes up. That’s a Scene. Here’s mine.


Switching back and forth between showing your screen with some sound and showing a silent photo, is as easy as clicking between “Scenes”


Note that this is a pretty straightforward scene. It’s named pause and just has two Sources or elements. The Creative Commons image and then the simple text that says be right back.

And another update: turns out that you may need to add an extra Source to ensure your mic is muted while you are away. Most people recommend muting your mic physically. I suggest a backup software mute as well. Add an audio source then turn it off.


As someone pointed out to me on Twitch during a livestream, make sure that you have no hidden audio sources! This bit me, too.


Working screen(s)

window stream

My scene, which shows things like my video, chat and so on, is setup like this in OBS.


Here are the Sources for this Scene.

  1. KapChat – if you see chats in other people’s streams and would like a chat stream in your videos, try KapChat. The sample video above does not have the chat yet :( I realized after publishing that other people couldn’t see what we were all were saying so now it’ll be there for future streams.
  2. PubNub Closed Captioning uses AI to automatically subtitle as you speak.. Cool as hell! Closed captioning enables the deaf and hard of hearing community to enjoy your stream. It also helps with people who’d prefer to watch the code on mute.
  3. Audio input capture – in this case, I set mine to “USB Audio Device” or “Default” which is how my Sades headset shows up.
  4. Video capture device – it automatically detected my built-in webcam and boom, that adds a video of me to the stream.
  5. Specific window – so I’m actually RDPing from a Mac to my Windows lab. This Source is that RDP window, the star of the show.
  6. Background – is the hammer photo in the background, which I got from Jason Helmick’s blog post

core dev – entire display

When I am developing for PowerShell Core, it’s easiest and best to develop on the Mac itself. Because of this, I share my entire primary display, as I need to show VS Code, GitHub Desktop, PowerShell itself and more.


You can see in the above screen, the only thing that changes is that the relevant Source changes from Specific window to Display Capture

Stream settings

I mostly use the settings that are from Best OBS Settings for Twitch. I had an issue with choppy video tho, and found these settings worked best.



I don’t understand the mechanics, but here’s what works for me, based off of a 2560×1440 native resolution:

  • Native Resolution: 2560 x 1440
  • Base Canvas Resolution: 1920 x 1080
  • Output (Scaled) Resolution: 1280 x 720

This is important: even though I have 7MB up and a decent setup, my stream started clipping any time my output resolution went above 1280 x 720. So if you think your internet is just weak, try lowering your output resolution.

But really, dig into Best OBS Settings for Twitch and personal testing for fine tuning. Be sure to give your stream at least 10 minutes to crap out.

Recording locally with OBS is a great way to test how your local configs sounds and see how will look when you’re streaming. Just hit Record instead of Stream. I also saw that you can test your stream with Twitch’s inspector but I haven’t played with that yet.

Twitch settings

So now that you’ve got your streaming software ready, let’s spruce up your Twitch channel.


First, to setup your avatar and banner, go to your profile. The banner is what appears at the top when you click someone’s avatar/screenname when visiting their channel. In my profile, it’s a picture of my office.

Note that the banner isn’t immediately visible when you visit a profile. It appears only after you click the user’s avatar.


Next to name your stream (some people update this each time, some leave it for good. The name of mine right now is powershell and chill), hit up your Dashboard Live settings

To add a Video Player Banner, go to your Dashboard Settings. On my channel, the Video Player Banner is the PowerShell Hammer.


The lil sections at the bottom of people’s channels are called Panels. You can add your own informational panels by clicking the Edit Panels button.


I found someone’s channel and liked their panels so I saved them and used them on my own channel because I figure panels are reused on twitch. Still not sure if that’s accurate or not but I’m thinking yes 🤔

Edit: Since this screenshot was taken, I’ve added three extensions. So this section can do text or image panels or extensions. Both are easy to config.

Panels are a popular thing to customize and you can even download packs of them. has a Panel generator. OMG, and they even have a Retro Wave Panel Package!


Chat Rules and Moderation

You may notice when you go to most channels, they have Chat Rules. The Chat Rules can currently be found on the Moderation Settings page under Channel Privileges. My chat rules are don’t be a d:\


From the Moderation Settings, you can also block specific terms and phrases. If you’d like a friend to be a moderator, you can add them as one to the Roles page.

I ban a whole lot of stuff, including non-friend raids because I just wanna PowerShell and chill, yenno?


Twitch will automatically record and archive your streams for you if you go to your Dashboard settings and Store past broadcasts.

Archiving to YouTube

Twitch archives your videos for a limited period of time, however. For extended viewing, most of us export our videos to YouTube. Twitch makes this easy.

  1. Navigate to Video Manager from the menu to access the list of videos you have created.
  2. Select Past Broadcasts and More.
  3. Select Export. Select a title and any settings you want to add.
  4. Set the privacy options, Public or Private.
  5. Select the Export button.

Sound sharing

Due to copyright issues, you can’t just stream any music. Twitch will literally silence portions of your video and YouTube also barks if you play copyrighted stuff or if their algorithm messes up.

To combat this, you can use a number of streamer-friendly music services, but most people I’ve seen use is Pretzel.

I’m not a huge fan of sharing music within my stream; it subjects portions of your video to be potentially muted and, even if you’re saying great stuff, people may still leave the stream because the music drives them crazy.


OBS blank/black screen

Using an laptop with Nvidia GPU to livestream and get an OBS black screen? This solution totally worked for Sander Stad who ran into the same issue.


Here are some handy links.

I plan to write a follow up post once I learn more about things like the benefits of subscriptions, affiliations and cool features like streaming to both Twitch and YouTube. Hope to see you soon on Twitch! 👩‍💻

Posted in Livestreaming, PowerShell

Weird Publish-Module errors

Recently, I was trying to publish a module and ran into an error:

Failed to generate the compressed file for module ‘Attempting to build package …’

After searching for a bit, I found someone who fixed a similar issue with a nuget reisntall. That got me thinking that my psd1 was not problematic, but rather my PowerShellGet was problematic.

So I Save-Module PowerShellGet -Path C:\temp then deleted the current PowerShellGet (manually using Explorer), reinstalled and voila. I was able to publish my module.

Posted in Uncategorized

Even faster PowerShell module loading

Update: This method is faster but some anti-virus software hate it. I’ve since reverted our method of import to an all-in-one ps1 👎

Considering dbatools now has over 500 commands, we are always eager to keep an eye on the speed of our import process.

As outlined in the blog post decreasing module import times, we’ve taken multiple approaches to reduce the import times, including combining all commands into one large allcommands.ps1 file.

Last week, I took it a step further.


I don’t know the in-depth internals of Import-Module, but I know that importing a DLL filled with C# cmdlets is extremely fast. For instance, Microsoft’s SqlServer module imports 100 commands in less than a second. Sometimes it’s closer to half a second!

I wondered if we could somehow compile our commands into a C# binary but that seemed far-fetched. One thing we could do, though, is use compression! It works for SQL Server backups, could it work for PowerShell?

Yes 😁

Turns out that the approach worked! I believe this is due to the performance benefits of streaming and reduced I/O. Note this technique is part of a multi-pronged approach which includes runspace and not using Get-ChildItem.

Here’s how I did it. First, each time I publish the module, I rebuild allcommands.ps1 then zip it. This reduces the size of our module on disk a bit as well, too, since the uncompressed ps1 is over 5MB and the zip is less than 1MB 👍

Set-Content -Encoding UTF8 -Path C:\github\dbatools\allcommands.ps1 -Value "### DO NOT EDIT THIS FILE DIRECTLY ###"
Get-ChildItem -Path "C:\github\dbatools\functions\*.ps1" -Recurse | Get-Content | Add-Content C:\github\dbatools\allcommands.ps1
Get-ChildItem -Path "C:\github\dbatools\internal\functions\*.ps1" -Recurse | Get-Content | Add-Content C:\github\dbatools\allcommands.ps1

Remove-Item -Path C:\github\dbatools\ -ErrorAction Ignore
Compress-Archive -Path C:\github\dbatools\allcommands.ps1 -DestinationPath C:\github\dbatools\
Remove-Item -Recurse C:\github\dbatools\allcommands.ps1 -ErrorAction Ignore

Next, I added the following to our module file. This code is run each time the module imports. You’ll notice that it opens the zip and streams it right in as a script block.

Add-Type -Assembly System.IO.Compression.FileSystem
$zip = [System.IO.Compression.ZipFile]::OpenRead((Resolve-Path -Path "$script:PSModuleRoot\"))
$stream = $zip.Entries.Open()
$reader = New-Object IO.StreamReader($stream)
$ExecutionContext.InvokeCommand.InvokeScript($false, ([scriptblock]::Create(($reader.ReadToEnd()))), $null, $null)



Trade off

What’s the trade off? More CPU usage on your part for the moment it takes to stream the file (though you’ll save on I/O) and for me, it’s an extra (automated) step.

Ultimately, this approach shaved off about a third of our import time. If you’re looking to squeeze as much speed out of your import as possible, compression can help. And don’t forget, if you have super slow imports, it may be your Execution Policy.

Posted in PowerShell

your code doesn’t suck

Recently, I had a couple colleagues tell me that their PowerShell code sucks.

One of them is a beginner who manages a large SharePoint farm and the other is more advanced and wrote a few commands that saves me hours of work each week.

See the disconnect there? Their PowerShell code, which helps manage Enterprise platforms and saves hours of work a week, not only doesn’t suck, it’s actually awesome.


your ps is actually awesome

Their PowerShell is awesome because it works. Their PowerShell code is awesome because they’re using it. It’s also awesome because the time they invested in creating code that:

  • Will save people time in the future
  • Helped them practice a valuable skill set
  • Keeps them relevant
  • Will look fabulous on their resume

Nobody goes from being a beginner to an expert overnight, and it’s important to allow ourselves the time to learn.

my own story

I feel like I’ve got code that sucks, too. In particular, I’m tortured by one of the commands I used to be super proud of, Import-DbaCsvToSql. I die inside when people talk to me about it, but I leave it in dbatools because people love it. It’s useful and, enough of the time, it works 😉

I learned a ton when I was creating that command, and even did a presentation about it.

The adventure of creating that command (and Bruce Payette attending my session!) was so exciting, it prompted me to dive even deeper into PowerShell.

Yet I fight back against my impulse to remove Import-DbaCsvToSql from dbatools. I literally have to resist the urge, but I do it by reassuring myself that:

  • One day I’ll rewrite it
  • Until then, some people really find it useful

Import-DbaCsvToSql is embraced because it’s fast. But it’s fast because it has no error handling. No error handling can be okay if you’ve got some perfect input, but input is rarely perfect.

The command simply doesn’t work enough for me, yet at the same time it tries to do too much. It totally stresses me out.

And, y’all, I showed this code, along with Start-SqlMigration.ps1 to Lee Holmes of the PowerShell team, all proud. He was so kind in response. I didn’t follow best practices, but he didn’t chide me. He said I was doing great things, and should keep on writing code and continue to improve along the way.

it’s all about adoption

Ultimately, I believe that Lee cared most that PowerShell had an enthusiastic adopter, even if I still had a lot to learn.

And I now realize that adoption is what’s actually important. Adoption will lead to that extreme excitement that I feel when I execute something and announce to my coworkers that I’m chillin because PowerShell is doing all my heavy lifting. From there, I’ll use that momentum to make my code even better.

Then I’ll invite my coworkers over to see my improved code, and we’ll celebrate. Then they’ll invite me over to see their improved code, and we’ll celebrate.

And then we’ll all live happily ever after, with our awesome code.

Posted in PowerShell