Announcing the Winner of the PowerShell TFM Book Contest

Two weeks ago, I started a PowerShell contest which required the participants to convert a string of text to title case. I didn't specifically say title case but I explained that the first letter of each word should be converted to upper case and all remaining letters in each word should be converted to lower case. This was because a search on how to convert to title case with PowerShell gave away a good portion of the answer. There were a total of 22 entries in the contest and all of them were Read more [...]

Code and Slides from my sessions at SQL Saturday 439

Today I presented two wildly successful sessions at SQL Saturday #439 in Columbus, GA. The code and slides from my "How do I Get-Started with PowerShell?" session can be downloaded here and the code and slides from my "PS C:\> Get-Started -With PowerShell Desired State Configuration" session can be downloaded here. The custom functions that are referenced in the code from the DSC session can be downloaded as part of my MrDSC module from GitHub. µ Read more [...]

PowerShell: Filter by User when Querying the Security Event Log with Get-WinEvent and the FilterHashTable Parameter

I recently ran across something interesting that I thought I would share. The help for the FilterHashTable parameter of Get-WinEvent says that you can filter by UserID using an Active Directory user account's SID or domain account name: Notice that the help also says the data key can be used for unnamed fields in classic event logs. I often hear the question wanting to know what the valid key pairs are for the hash table. As you can see, they're listed in the Read more [...]

Windows PowerShell TFM Book Contest and Giveaway

Today is the first day of Autumn also known as fall here in North America and it's my favorite time of the year. If nothing else, you've got to love the cooler weather and the changing of tree leaf colors. Last fall, a new version of the Windows PowerShell TFM book that I co-authored along with Jason Helmick was published and strangely enough, its design is remarkably similar to the colors that are associated with Autumn. SAPIEN Technologies who is the publisher of the book is providing one Read more [...]

Working around UAC (User Access Control) without running PowerShell elevated

We've all heard it and experienced the problem where you can't perform tasks such as stopping a service on the local machine with PowerShell unless your running PowerShell elevated. If the title bar doesn't say "Administrator" then you'll end up with these types of error messages: If PowerShell remoting is enabled on the local machine, you can simply remote back into it to perform the task without having to run PowerShell elevated: This Read more [...]

Video & Presentation Materials: September 2015 PowerShell.org Advanced Functions TechSession Webinar

Last week I presented a session titled "The Top 10 Considerations When Writing PowerShell Advanced Functions" for the September 2015 PowerShell.org TechSession Webinar. The video from that presentation is now available: The presentation materials including the code and slides can be downloaded from here. I received a question during the presentation about how to determine what the type accelerators are and the answer to that question can be found in this Hey, Scripting Guy! Blog article Read more [...]

#PowerShell: DelayedAutoStart Property added to the Win32_Service WMI Class in Windows 10 RTM

I recently discovered that Windows 10 adds a DelayedAutoStart property to the Win32_Service WMI Class: I've verified that this property does not exist on prior operating systems such as Windows 8.1 even when they're updated to the production preview version of PowerShell version 5. I had written a Hey, Scripting Guy! Blog article on how to query the registry of remote machines to "Exclude Delayed Start Services when Checking Status with PowerShell" that shows Read more [...]

#PowerShell: Splatting a Local Hash Table in a Remote Session

I'm sure that most people who use PowerShell on a regular basis are familiar with the "Using" variable scope modifier which allows for the use of local variables in a remote session. This functionality was introduced with PowerShell version 3: A fairly simple concept, right? But wait a minute, did you know that you can also define a local hash table to be used with splatting in a remote session using this same concept? The Read more [...]

My Solution: August 2015 PowerShell Scripting Games Puzzle

A couple of months ago, PowerShell.org announced that the PowerShell Scripting Games had been re-imagined as a monthly puzzle. In August, the second puzzle was published. The instructions stated that a one-liner could be used if you were using a newer version of PowerShell. A public JSON endpoint can be found at http://www.telize.com/geoip and your goal is to write some PowerShell code to display output similar to the following: Try to accomplish this with a Read more [...]

Video from Atlanta TechStravaganza 2015: Using PowerShell Desired State Configuration in your On-Premises Datacenter

This past Friday, I presented a session titled "Using PowerShell Desired State Configuration in your On-Premises Datacenter" at Atlanta TechStravaganza 2015. Fellow PowerShell MVP Stephen Owen took this photo as I was preparing for my session: Another fellow PowerShell MVP, Jonathan Walz of the PowerScripting Podcast, recorded all of the sessions in the PowerShell track which can be found on their YouTube channel. Several presentations are included in each of the videos and mine is Read more [...]

Remove App Packages from Windows 10 Enterprise Edition

So you've installed Windows 10 enterprise edition only to find applications that you would consider to be consumer type apps such as Bing Finance, News, and Sports which is not what you would normally expect to find in an enterprise edition operating system version: You can obtain a list of these app packages for the current user with the Get-AppxPackage PowerShell cmdlet. I've sorted the list of app packages by name in the following results: I've determined Read more [...]

DSC session at Atlanta TechStravaganza one week from today!

Have you seen the awesome lineup of speakers and sessions for Atlanta TechStravaganza this year? Mark Minasi is the keynote speaker and there's an all day dedicated PowerShell track where Ed (The Scripting Guy) Wilson will be presenting along with several PowerShell MVP's including Stephen Owen, and me (of course). My presentation is on "Using PowerShell Desired State Configuration in your On-Premises Datacenter" and I'll share the initial slide of my slide deck that I created exclusively for Read more [...]

Change a Machine’s Subnet Mask with PowerShell Version 2

I recently worked on a project that required me to change the subnet mask on multiple servers at a remote location. The main problem was that many of the servers were still running PowerShell version 2, but luckily PowerShell remoting was enabled on all of them. This script takes into account multiple network cards and multiple IP addresses being assigned to the same network card. I discovered that the array needed to be reversed in order to assign the primary IP Read more [...]

My Solution: July 2015 PowerShell Scripting Games Puzzle

Last month, PowerShell.org announced that the PowerShell Scripting Games had been re-imagined as a monthly puzzle and the first puzzle was published. The instructions stated to use a PowerShell one-liner that produces the following output. No more than one semicolon should be used, do not use the ForEach-Object cmdlet or one of its aliases. The one-liner should be able to target more than one computer and feel free to go crazy with a really short one-liner with aliases and whatever else. Although Read more [...]

Using PowerShell for Remote Server Administration in Windows 10 RTM without the RSAT tools

You've updated to the RTM version of Windows 10 only to learn that the remote server administration tools aren't available as of yet: Let's say for example the Active Directory PowerShell module is something that you use on a daily basis and it's necessary to perform your day to day responsibilities. Well, you're out of luck because the RSAT tools aren't available yet, but before you consider using RDP or the GUI to perform your duties, let's take a look at Read more [...]