Store Environmental Code in a SQL Server Database for PowerShell Operational Validation Tests

I've previously published articles on separating environmental code from structural code for both DSC (Desired State Configuration) and Operational Validation or Readiness Tests. This article picks up where I left off last week in "Separating Environmental Code from Structural Code in PowerShell Operational Validation Tests". As many existing open source PowerShell functions as possible have been used in the examples shown in this blog article instead of re-inventing the wheel and rewriting everything Read more [...]

Separating Environmental Code from Structural Code in PowerShell Operational Validation Tests

Do you ever feel like you're writing the same operational validation or readiness test over and over again? I'm not sure about you, but I don't like repeating myself by rewriting the same code because it creates a lot of technical debt. There has to be a better way <period>. Why not take the same thought process from DSC (Desired State Configuration) and separate the environmental portion of the code from the structural portion and apply it to operational tests so the same or similar code isn't Read more [...]

Use PowerShell and Pester for Operational Readiness Testing of Altaro VM Backup

I've recently been working with Altaro VM Backup and I must say that I've been very impressed with the ease and simplicity of the product. The back-end portion of the product can run on a virtual or physical server with or without the GUI (Server Core is supported). It can backup to just about any type of drive (local disk, UNC path, USB drive, etc). It doesn't require SQL Server. In my environment, adding a Hyper-V server (running Windows Server 2012 R2) installed a service on the Hypervisor, but Read more [...]

Learning Existing and Setting Up New Keyboard Shortcuts in Visual Studio Code for the PowerShell Enthusiast

I've recently made myself start using Visual Studio Code for writing some of my PowerShell code and I thought I would share a few of the tips that I've learned. If you haven't read my blog article titled "Use the PowerShell Console from within Visual Studio Code", I definitely recommend taking a look at it as today's blog article assumes that you've already made those modifications to your Visual Studio Code environment. When you first open Visual Studio Code, it defaults to plain text (I haven't Read more [...]

Speaking on PowerShell Toolmaking this weekend at {dev = data} DAY Birmingham 2016

I'll be presenting a session on PowerShell Toolmaking with Advanced Functions and Script Modules this Saturday, August 20th at {dev = data} DAY Birmingham 2016. Here's what you can expect from my session: "Transitioning from writing PowerShell one-liners and basic scripts to creating reusable PowerShell tools with advanced functions and script modules can be a daunting task and with all the different ways that you’ll find on the Internet to accomplish the same task, it can definitely seem Read more [...]

Use the PowerShell Console from within Visual Studio Code

I recently revisited Visual Studio Code. I was looking for a markdown editor and remembered seeing a tweet a few weeks ago saying that VS Code could be used to edit markdown. It supports markdown by default, although I would recommend adding a spell check extension to it. I thought that it would be convenient if I could write my PowerShell code right from within the same interface that I'm writing other things such as markdown. One of the problems that I previously experienced with VS Code is Read more [...]

Speaking on both PowerShell and DSC at SQL Saturday Baton Rouge 2016 this Weekend!

Although PowerShell has been around for 10 years now, there are still some who are just getting started with it. There are several categories that new comers fit into, some are just starting out in their career, others may be career changers, and others may have been in the industry for a number of years and are finally trying to embrace PowerShell. Regardless of which category you fit into, I'll be presenting a session on "PowerShell Fundamentals for the Absolute Beginner" at SQL Saturday #515 Read more [...]

Something to -notlike about the -like operator in PowerShell

I recently ran into a problem with the PowerShell like operator that I wanted to share since what's occurring may not be immediately apparent. The like operator allows for comparison tests of strings using wildcard characters instead of exact matches. I think of it being similar to the match operator except like uses simple wildcards instead of regular expressions. Easy enough, right? A string on the left and another string with wildcards on the right. If Read more [...]

Automatically place an Android Phone on Vibrate at Work

Whether or not your place of employment requires that your cellphone be placed on silent or not while in the office, it's simply a common courtesy to prevent interruptions and distractions to your co-workers when your twenty-seven different social media, email, phone, voicemail, and shopping applications that are installed on your phone constantly chime or play your favorite song every thirty seconds. The problem is, who can remember to silence their phone after arriving in the office before Read more [...]

PowerShell function for creating a PowerShell function template

A couple of weeks ago I published a blog article "PowerShell function for creating a script module template" and I thought I would follow-up that article with the same type of function for creating a PowerShell function template. Instead of having to remember things like checking to make sure an approved verb is used, that a Pester test is created, and comment based help is entered in the right format, a template such as the one shown in the following code example can make your life much simpler. When Read more [...]

Renewed for another year as a Microsoft MVP

I received notification last Friday, July 1st that I've been renewed for another year as a Microsoft MVP. This is my third MVP award, two as a PowerShell MVP and now one as a Cloud and Datacenter MVP. Although I'm now considered a Cloud and Datacenter MVP due to the changes to the Microsoft's MVP program, my focus is still PowerShell. I look forward to seeing my fellow MVP's at the MVP Summit again later this year. In addition to being a multiyear recipient of the Microsoft MVP award, I'm Read more [...]

PowerShell function for creating a script module template

I'm curious to know what process others use to create new PowerShell script modules? Since the initial process of creating a PowerShell script module seems redundant and tedious, I decided to create a function that creates a template for new script modules that I create which includes creating both the script module PSM1 and manifest PSD1 files and filling in the information that I would normally include: When the previous function is run, a folder with the specified Read more [...]

Learn Building Unconventional SQL Server Tools in PowerShell this weekend at SQL Saturday Chattanooga 2016

I’m presenting a session on Building Unconventional SQL Server Tools in PowerShell this weekend at SQL Saturday #498 in Chattanooga. Ever had records from a SQL Server database table come up missing? Maybe someone or some process deleted them, but who really knows what happened to them? Wouldn’t it be awesome to create a free tool with PowerShell that automates the task of sifting through the transaction log backups and even the active transaction log to determine when deletes occurred Read more [...]

PowerShell function to find information about module updates

I decided to update the one liner from my blog article last week and take it a step further by turning it into a reusable tool that displays information about module updates that are available regardless of where they were installed from. As shown in the previous results, the function lists modules that have updates available regardless of where they were originally installed from. It also lists the installed version and location Read more [...]

Update Manually Installed PowerShell Modules from the PowerShell Gallery

There are PowerShell modules that ship with Windows 10 that weren't installed from the PowerShell Gallery using PowerShellGet so they can't be updated using the Update-Module cmdlet. This also applies for any modules that you've installed manually yourself. The following PowerShell script retrieves a list of the most recent version of the modules in the all users path for PowerShell modules. It determines which ones weren't installed using PowerShellGet based on the hidden xml file that would Read more [...]