A Rant about some Blogs, Magazine Articles, Books, Training Videos, Presentations, Etc

<Begin Rant> I find it funny, yet sad that I often see blogs, magazine articles, books, training videos, presentations, etc where the author says something to the effect of "Never do <fill in the blank>". Then they proceed by doing exactly what they just said not to do like four-hundred times throughout their book, blog, etc. and when asked about it, the author says "Oh, that's only acceptable for demonstration purposes". I also see this in the form of an author saying something to Read more [...]

Converting a SQL Server Log Sequence Number with PowerShell

As demonstrated in one of my previous blog articles "Determine who deleted SQL Server database records by querying the transaction log with PowerShell", someone or something has deleted records from a SQL Server database. You've used my Find-MrSqlDatabaseChange function to determine when the delete operation occurred based on information contained in either transaction log backups or the active transaction log: You're ready to perform point in time recovery Read more [...]

Pro Tips from the Trenches: The Resolve-Path PowerShell cmdlet

You're designing a reusable tool in PowerShell and decide a function is the most appropriate type of command to accomplish the task at hand. It will accept a FilePath parameter which will be used to specify both the path and filename to a destination file. The path should already exist, but the file may or may not already exist. For simplicity, I've stripped away the complexity so the problem is more apparent. This function validates that the parent path exists and then returns the absolute path Read more [...]

Run 350 Nano Server Virtual Machines on a Lenovo ThinkPad P50 with Hyper-V in Windows 10

If you're a frequent reader of my blog articles on this site, then you're already aware that I recently purchased a Lenovo ThinkPad P50 with a Xeon CPU, 64 GB of RAM, and upgraded it to SSD hard drives as shown in my previous blog article. I tweeted that it wouldn't be complete without a few PowerShell stickers: I received a response from Jeffrey Snover wanting to know how many Nano server VM's could be run on it: I took that as a challenge and decided to spin up as many Nano server Read more [...]

Upgrade to SSD Hard Drives in a Lenovo ThinkPad P50

I recently purchased a Lenovo ThinkPad P50. It's certainly not the sleekest machine on the market, but don't judge a book by its cover. I picked this model because it offers an Intel Xeon CPU and up to 64 GB of RAM in a 15 inch laptop. My previous computer was a Dell Latitude e6530 which is about the same form factor, although the older one is a little thicker and slightly larger and heavier due to the extended battery that sticks out of the back of it. The ThinkPad doesn't have an optical drive Read more [...]

Determine the Packt Publishing Free eBook of the Day with PowerShell

First of all, let me state that I'm in no way affiliated with Packt Publishing other than being a customer. They offer a free eBook each day and that information is freely available on the Internet. Like any information on the web, it's publicly available and you can read it with a web browser or with something like PowerShell. As shown in the following example, a PowerShell one liner can be used to determine their free eBook of the day: This requires PowerShell Read more [...]

Use PowerShell to Add Active Directory Users to Specific Groups based on a CSV file

I recently responded to a post in a forum about adding Active Directory users to groups with PowerShell based on information contained in a CSV (Comma Separated Values file format). I thought I would not only share the scenario and solution that I came up with but also elaborate on adding additional functionality that may be desired. In this scenario, you’ve been provided with a CSV file that contains a list of Active Directory users and the groups that they should be a member of as shown in Read more [...]

Git status doesn’t know if your local repository is out of date

To setup the scenario that will be demonstrated in this blog article, a new commit has been pushed to the dev branch of my PowerShell repository on GitHub from a computer named PC01. Then I switched over to using to an alternate computer named PC02 that was up to date prior to that latest commit being pushed to GitHub from PC01. This means that the dev branch of the PowerShell repository on PC02 is one commit behind the remote origin on GitHub. You would think that checking the status of the dev Read more [...]

Configuring the PowerShell ISE for use with Git and GitHub

The goal of this blog article is to configure the PowerShell ISE (Integrated Scripting Environment) so the management of Git version control can be performed from it. Most tutorials you'll find will attempt to lead you down the path of using SSH instead of HTTPS to synchronize your repositories to GitHub from the command-line but that's really over-complicated and unnecessary if you're using a Windows based machine. The client machine used in this blog article runs the 64 bit version of Windows Read more [...]

Video: Making the Leap from PowerShell One-Liners and Scripts to Advanced Functions and Script Modules

This past Tuesday, I presented a session for the Arizona PowerShell Users Group on “Making the Leap from PowerShell One-Liners and Scripts to Advanced Functions and Script Modules”. The video from that presentation is now available: https://youtu.be/2tPCNSJXicI The presentation materials including the code and a PDF copy of the slide deck can be downloaded from here. µ Read more [...]

How to install the new preview version of the PowerShell ISE

The PowerShell team released a new preview version of the PowerShell ISE (Integrated Scripting Environment) this week. This is the first time a new version of the PowerShell ISE has been released separately from a new version of the WMF (Windows Management Framework). This new approach reminds me of how they shipped the help separately from the WMF beginning with PowerShell version 3.0. Best of All, this new preview version of the ISE is a module which is distributed via the PowerShell Gallery Read more [...]

Getting Started with the Git Version Control System – Part 2

In my last blog article, I demonstrated a few Git basics which were all performed on a local repository. Today I'll pick up where I left off in that blog article and clone my local MrSQL repository to a file server so others can clone it to their machine from there. Git is a distributed version control system and others could simply clone the repository to their machine directly from mine but placing it on a server will give us a more centralized location that's backed up and one that will always Read more [...]

Getting Started with the Git Version Control System

There's a lot to Git and there's tons of information all over the web about it. There's so much information out there that you might feel overwhelmed when you first start trying to learn what Git is and how to use it. The purpose of this blog article is to help you install Git, teach you a few basics, and point you in the right direction to learn more. I'll start with a little background information: Back in 2009 when I started blogging on this site, I used the TechNet script repository to share Read more [...]

#PowerShell Script Module Design: Placing functions directly in the PSM1 file versus dot-sourcing separate PS1 files

So you've transitioned from writing PowerShell one-liners and scripts to creating reusable tools with functions and script modules. You may have started off by simply placing your functions in a PS1 file and dot-sourcing it. That leaves a lot to be desired though since it's a manual process and even if you've added some code to your profile to accomplish that task, the experience still isn't as good as it could be. Many of the short comings can be alleviated by simply placing your functions into Read more [...]

Building logic into PowerShell functions to nag users before their Active Directory password expires

This week I'm sharing a couple of PowerShell functions that are a work in progress to nag those users who seem to never want to change their passwords. I can't tell you how many times the help desk staff at one of the companies that I provide support for receives a call from a user who is unable to access email or other resources on the intranet. The problem? They have run their password down to the point where they arrive in the morning, log into their computer without issue, and during the day Read more [...]