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…
Tag: Scripting
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…
PowerShell at TechMentor
If you weren’t able to make it to the PowerShell Summit last week, all is not lost. There will be plenty of PowerShell at TechMentor which will be held August 11-15 in Redmond, WA on the beautiful Microsoft campus. I will be presenting on how to use the CIM cmdlets to manage your datacenter, reporting…
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…
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…
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….
Reflections on the PowerShell Scripting Games
During the most recent PowerShell Scripting Games, I was fortunate enough to be one of the judges. Now that the games have concluded I thought I’d share my reflections on the entries. Naturally these are merely my opinions but they are drawn from years of experience with PowerShell and almost 25 years as an IT…
There’s Sum-thing Happening Here
I am one of those IT Pros who keeps close tabs on system resources. I like to know what is being used and by what. As you might imagine, a cmdlet like Get-Process, is pretty useful to me. One of the things I’m always checking is how much memory Google Chrome is taking. I don’t…
Friday Fun: The Measure of a Folder
Last week, I demonstrated how to measure a file with PowerShell. This week let’s go a step further and measure a folder. I’m going to continue to use Measure-Object although this time I will need to use it to measure numeric property values. Here’s the complete function after which I’ll point out a few key…