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…
Category: PowerShell
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…
Add Logon As Service Right with PowerShell
I saw a comment on Twitter today about a limitation in PowerShell. Specifically the ability to grant the logon as a service right to a user account. Manually, if you use the Services management console and specify the user, Windows will automatically grant that right. But if you are trying to do this from a…
Another PowerShell Valentine
I’ve been sharing some Valentine’s Day themed fun on Twitter today. This one is a bit too long to fit into a tweet. $text = “Happy$([char]3)Valentine’s$([char]3)Day” $text.ToCharArray() | foreach -begin { $colors = “Cyan”,”Magenta”,”Yellow”,”White”,”Red”,”DarkRed”,”Green” } -process { write-host $_ -NoNewline -ForegroundColor ($colors| Get-Random)} -end {“`n”} To get the full effect you need to run in…
Friday Fun: The Measure of a File
I’ve been working with PowerShell since the days of Monad and have written a lot of PowerShell scripts. Out of idle curiosity, and the need for a Friday Fun topic, I decided to see how many lines of PowerShell I have written. Or at least that are in my Scripts folder. Turns out I have…
Get PowerShell Parameter Aliases
During a recent PowerShell training class we naturally covered aliases. An alias is simply an alternate name, often something that is shorter to type, or maybe even more meaningful. There are aliases for commands, properties and parameters. Discovering aliases for commands is pretty easy with Get-Alias. Property aliases are discoverable using Get-Member. But, discovering parameter…
PowerShell Essentials Webinar
Tomorrow I will be presenting a day of PowerShell training via a series of webinars for Windows IT Pro magazine. I will be presenting 3 webinars, each about 1 hour in length. The first webinar is on the PowerShell syntax and shell. Basically, how to survive in the shell if you are beginner. The second…
Creating CIM Scripts without Scripting
When Windows 8 and Windows Server 2012 came out, along with PowerShell 3.0, we got our hands on some terrific technology in the form of the CIM cmdlets. Actually, we got much more than people realize. One of the reasons there was a big bump in the number of shipping modules and cmdlets was CDXML….
Your Future in PowerShell
I recently wrote an article that I hope will get you thinking about how PowerShell will affect your career, how it will be used and where you on the PowerShell career pipeline. Thanks in advance for taking a few minutes to read my article on the 4Sysops site and let me know what you think….
Friday Fun with REST, Regex and Replacements
I just love using the web cmdlets that were introduced in PowerShell 3.0. One of the cmdlets I use the most is Invoke-RESTMethod. This isn’t because I’m dealing with sites that offer REST-ful services, but rather I like that the cmdlet does all the heavy lifting for me when I point it to an RSS…
I Want PowerShell 4.0
I’ve been writing a bit about PowerShell 4.0 lately, especially on my Prof. PowerShell column. If you are running Windows 7 it isn’t too difficult to go to http://www.microsoft.com/en-us/download/details.aspx?id=40855 and download the Windows Management Framework 4 package. Remember you will also need version 4.5 of the .NET Framework. This will also apply to Windows Server…
PowerShell Deep Dive First Sales
Last year I had the pleasure of editing PowerShell Deep Dives, published by Manning. This book is a community project with chapters contributed from MVPs and leading members of the PowerShell community. You won’t find this content anywhere else. Anyway, I have the first royalty report from Q3 2013. Looks like we sold a little…