Recently I was conversing with someone about my PowerShell code that downloads tools from the live Sysinternals site. If you search the Internet, you’ll find plenty of ways to achieve the same goal. But we were running into a problem where PowerShell was failing to get information from the site. From my testing and research…
Category: PowerShell
Friday Fun with Formatting
PowerShell is very adept at retrieving all sorts of information from computer systems in your network. Often the data is in a format that is hard to digest at a glance. For example, when you see a value like 1202716672 is that something in MB or GB? What if you need to view that value…
PowerShell Reminder Jobs
This is something that might be better suited to one of my Friday Fun columns, but I’m enjoying this so much I couldn’t wait to share it. I don’t know about you but I spend much of my day in PowerShell or at least with a PowerShell session running. I have an ongoing quest to…
DSC Resource Snippets
A few days ago I posted a PowerShell script that would generate a DSC configuration template. The idea was to generate all the code you might need and let you whittle it down to just what you need. On my primary system, I don’t have any community or experimental DSC resources so my configuration template…
Test Subnet with PowerShell
A few years ago I published a PowerShell function to test IP addresses on a given subnet. I had an email the other day about it and I decided to refresh it. My new version adds a few bells and whistles that I think you might like. For example, you can now run it from…
Happy Birthday Pluralsight
Pluralsight is celebrating its 10th birthday today. As part of their celebration they are running a quick contest with a cool prize. They also asked authors for a birthday greeting or message. Since all of my courses are PowerShell related it seemed only fitting to do something like this: Sure, hardly a practical use of…
Get Remote PowerShell Session Connections
During a recent PowerShell training class we naturally covered PowerShell remoting. During the discussion I explained that a remote PSSession is essentially transparent to any currently logged on user. Unless of course you reboot the computer! One way you can identify a remote session is by the presence of the wsmprovhost process. You should see…
Remove All but Most Recent PowerShell job
I like sending little PowerShell tweet tips, but this one is a bit too long for Twitter. Here is a one-liner to remove all but the most recent job result for each job name. get-job | group Name | foreach { $_.group | sort PSEndTime -descending | Select -skip 1 | remove-job -whatif} This assumes…
Friday Fun Send a Colorful Message
Next week is Pluralsight’s 10th anniversary. In preparing for that happy event, I wanted to send a special greeting. Of course, because my courses are on PowerShell it only seemed appropriate to use PowerShell to display my message. In fact, let’s jump right to the result. Here’s how I did it. #requires -version 3.0 #get…
Configure Local User Account with DSC
Yesterday I posted an article on how to use PowerShell and the [ADSI] type accelerator to set a local user account. However, if you are running PowerShell 4.0 you have another option: Desired State Configuration (DSC). I’m going to assume you have some basic understanding of how DSC works. If not, head over to the…
Set Local User Account with PowerShell
The other day I received an email from a student asking for some help in using PowerShell to take care of a user account on a local computer. He not only wanted to be able to set the password, which he had already figured out, but also how to enable or disable the account, which…
Save the PowerShell Children
I just received the royalty statement for Q4 2013 on the PowerShell Deep Dives book. While I appreciate every sale, I know the community can do better. In case you didn’t know, this book is a compilation of PowerShell nuggets you won’t find anywhere else. Chapters were contributed by MVPs, leaders in the PowerShell community…
Friday Fun: Create All PowerShell Profile Scripts
Whenever I train on PowerShell I inevitably get around to discussing PowerShell profile scripts. For those of you new to PowerShell, a profile script is where you put all the commands you want to run that will define your PowerShell session just the way you need it. You might load some snapins, create some PSDrives…
More Fun with String Properties
The other day I posted an article about converting string properties that you might get from running a command line tool into a PowerShell named property. I was continuing to experiment with it. Here’s some code on how I could use it. $raw = qprocess $properties = $raw[0] -split “\s{2,}” | Convert-StringProperty $raw | select…
Convert a String to a PowerShell Property Name
Over the last few years I’ve written and presented a bit on the idea of turning command line tools into PowerShell tools. We have a lot of great CLI based tools that are still worth using. What I’ve done is come up with tools and techniques for turning their output into an object that can…