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…
Friday Fun: Find File Locking Process with PowerShell
I was asked on Twitter this morning about a way to find out what process has a lock on a given file. I’m not aware of any PowerShell cmdlet that can do that but I figured there had to be a .NET way and if I could find a code sample I could put something…
InfoWorld: Automate Live VM Export
This is kinda cool, but I got published in InfoWorld, in a roundabout manner. J. Peter Bruzzese writes a column for InfoWorld on enterprise Windows. His latest column is about exporting Hyper-V virtual machines using PowerShell. In Windows Server 2012 R2 (and Windows 8.1) you can export a virtual machine even while it is running….
The Ultrabook Quest is Ended
Over the last several weeks I’ve been researching, thinking and mulling over a decision for a new laptop. In short, I was looking for something smaller in the ultrabook form factor that could still run a few Hyper-V virtual machines. In the end I decided to compromise and ended up with a Yoga Pro 2…
Find and Replace Text with PowerShell
I’ve just finished up a series of tweets with a follower who had a question about finding and replacing a bit of data in a text file. In his case it was a web.config file but it really could be any text file that you can view in PowerShell. In PowerShell 3.0 and later this…