VS Code Rendering Problem in the PowerShell Integrated Terminal

I recently discovered a rendering problem in VS Code where pressing escape doesn't delete a multi-line command in the PowerShell integrated terminal. I created a video to report the problem and I thought I would share it here since the quality was less than optimal when sharing it on Twitter. https://youtu.be/0dySuC0RV4o Here's a link to my original tweet to David Wilson and here's a link to the GitHub issue that Max Trinidad has created. µ Read more [...]

PowerShell One-Liner to Audit Print Jobs on a Windows based Print Server

You've been tasked with auditing print jobs on your company's Windows based print server to determine who is wasting so much paper, toner, and causing excessive wear and tear on printers. No budget exists for this task and you need to have something to show by the end of the day. You would probably start off by searching the Internet, but most of the results you'll find to accomplish this task are over-complicated or simply don't work. Luckily this task can be accomplished with a PowerShell one-liner. Read more [...]

PowerShell PackageManagement and PowerShellGet Module Changes in Windows 10 Version 1511, 1607, and 1703

Recently, I reloaded my computer and noticed a problem when I tried to install the latest version of the Pester PowerShell module using PowerShellGet. I loaded Windows 10 version 1703 (the creators update) which has PowerShell version 5.1 installed by default: Pester version 3.4.0 ships with both Windows 10 version 1607 and 1703. Both of these versions of Windows and/or PowerShell seem to work differently than previous versions when updating and/or installing Read more [...]

Presenting PowerShell 101: The No-Nonsense Beginner’s Guide to PowerShell this weekend at SQL Saturday Baton Rouge

Late last night I received an email about a session being cancelled at SQL Saturday #628 in Baton Rouge which is scheduled for tomorrow, Saturday, July 29th. I'll be presenting my PowerShell 101: The No-Nonsense Beginner’s Guide to PowerShell session in that time slot which is the first session of the day in the PowerShell track, beginning at 9:15am. I've presented this session a couple of times this year at other events and I've tweaked it each time based on the feedback I've received. Read more [...]

Operational Validation Testing of SQL Server with PowerShell and Pester this weekend at SQL Saturday Baton Rouge

If you're interested in a free day of PowerShell training, there are numerous sessions on different topics in the dedicated PowerShell track at SQL Saturday #628 in Baton Rouge, Louisiana this Saturday, July 29th. I'll be presenting a session on how to "Automate Operational Readiness and Validation Testing of SQL Server with PowerShell and Pester". Here’s a little information about what you can expect from my session: Automate Operational Readiness and Validation Testing of SQL Server Read more [...]

Remove all user defined variables without restarting the PowerShell Console or ISE

Recently, fellow Microsoft MVP Mickey Gousset asked me how to remove existing user defined variables from the PowerShell ISE (Integrated Scripting Environment) before running a script a second time without having to restart the ISE. While you could keep track of the variables you've used within your script to remove them once the script completes with the Remove-Variable cmdlet or by deleting them from the variable PSDrive, that can be a less than desirable solution for long and complicated scripts Read more [...]

Copy databases from 5 different SQL Servers in 100 seconds with the DBATools PowerShell Module

As referenced in my blog article from yesterday, I'll be presenting a PowerShell 101 session at SQL Saturday Atlanta tomorrow morning (July 15, 2017). While I plan to cover the basics of PowerShell, I also plan to show you what you can do with PowerShell without having to write very much code at all. I'll be killing it in my session with live demos including this one that I've made a video of as a sneak preview. https://youtu.be/wBEqHwmM-z8 If the video embedded in this webpage doesn't display Read more [...]

Presenting PowerShell 101: The No-Nonsense Beginner’s Guide to PowerShell this weekend at SQL Saturday Atlanta

If you're interested in some free PowerShell training where you'll learn the basics of PowerShell from a best practices standpoint, I'll be presenting a session on "PowerShell 101: The No-Nonsense Beginner’s Guide to PowerShell" at SQL Saturday #652 in Atlanta, Georgia this Saturday, July 15th. My presentation begins at 8am eastern time and is a beginner level session. There's also a Powering Azure from PowerShell session that Microsoft MVP Robert Cain is presenting at 2:15pm. Here’s Read more [...]

Encrypt a Password with PowerShell for use by a Different User and/or on a Different Computer

Storing a password in an encrypted file for use by the same user on the same computer using PowerShell is fairly easy, but storing a password in an encrypted file for use on another computer or by another user is a bit more challenging. It requires the use of a key file and of course if someone else can read the key file, then they also can decrypt the password. In my scenario, I work in a VDI (Virtual Desktop Infrastructure) environment that doesn't use persistent desktops and I need to have Read more [...]

Renewed as a Microsoft Cloud & Datacenter Management MVP

I'm honored and humbled to have been awarded the Microsoft MVP award for a fourth consecutive year. I received email notification yesterday confirming that I've been renewed for another year. The first two Microsoft MVP awards that I received were for PowerShell and due to changes to Microsoft's MVP award program, the latest two have been for Cloud and Datacenter Management, although my focus is still PowerShell. In addition to being a multiyear recipient of the Microsoft MVP award, I'm also Read more [...]

Automatically Customizing the PowerShell ISE on Startup

This past weekend while at SQL Saturday Chattanooga, I was asked if it was possible to have the PowerShell ISE (Integrated Scripting Environment) automatically open with a right/left split pane: Instead of the top/bottom default split pane: One thing to note is that by default the PowerShell ISE will reopen in whatever configuration you close it in, which could be either of the ones previously shown or the full screen editor. If you want the ISE to open with a certain configuration Read more [...]

Presenting PowerShell Non-Monolithic Script Module Design this weekend at SQL Saturday Chattanooga

If you’re interested in some free PowerShell training, I’ll be presenting a session on "PowerShell Non-Monolithic Script Module Design" at SQL Saturday #624 in Chattanooga, Tennessee this Saturday, June 24th. My presentation begins at 1:15pm eastern time and is an intermediate level session. There's also a PowerShell precon on Friday being presented by Microsoft MVP Aaron Nelson (the precon is not free) and a PowerShell DSC (Desired State Configuration) session on Saturday being presented Read more [...]

Simple Obfuscation with PowerShell using Base64 Encoding

I recently received a question from someone wanting to know how I encoded a string of text on my blog site. Back in January of 2013, I competed in Jeff Hicks PowerShell Challenge that was held by TrainSignal. One of the questions had an encoded command which you were to decode. I figured out that the -EncodedCommand parameter of PowerShell.exe could not only be used to run commands that are encoded with Base64, that it could also be used to easily decode a string of text that was encoded with Base64. The Read more [...]

What is this Module Scope in PowerShell that you Speak of?

Last week I posted a blog article about a PowerShell script module that I had written with a few proof of concept commands to manage a Nimble Storage Area Network using their REST API. That module used a command to connect and authenticate to the storage device which needed to share a token with other commands in the module otherwise authentication would have to be performed for each command. I initially placed the token in a global variable even though I mentioned in the blog article that I’m Read more [...]

PowerShell and the Nimble Storage REST API

If you read my previous blog article on "PowerShell Function to Determine the Installed VSS Providers" then you're already aware that I recently migrated one of my customers to a Nimble Storage Area Network. While Nimble does have a PowerShell module and it's decent, I wanted to see how difficult it is to work with their REST API directly with PowerShell. Their REST API documentation also seems to be decent. Note: All of the functions shown in this blog article are a proof of concept and should Read more [...]