I’ve been experimenting with different techniques to work with PowerShell in graphical ways, but without resorting to complex solutions such as WinForms or ShowUI. For today’s Friday Fun I have a little script that presents a drive usage report using WMI and Out-GridView. As always, my goal with these articles is to impart a nugget…
Category: PowerShell
Capture the Moment
I’m very excited that the PowerShell books I’ve been working on this year will finally begin hitting the shelves, and hopefully your desk, over next month or two. If you’ve been locked in the datacenter and have no idea what I’m talking about, you can check them out on my Books page. If you’ve already…
Friday Fun – Test PowerShell Command Name
Earlier this week I exchanged a few tweets with @jonhtyler about coming up with a proper name for a PowerShell function he was developing. The suggested best practice is to use the Verb-Noun naming convention, using an accepted verb. You can see the verbs with the Get-Verb cmdlet. So I figured why not automate this…
Hyper-V VHD Summary
When I made the move to Windows 8, one of my tasks was to migrate my test environment from VirtualBox to Hyper-V. Windows 8 includes a client Hyper-V feature that is easy to use and includes PowerShell support. Plus I needed to expand my Hyper-V skills anyway, especially from the console. After setting up a…
PowerShell Version Profile Tips
Now that PowerShell v3 is finally and officially with us, I’m trusting that many of you are embracing it. I’ve made the jump, although I have had to make some minor adjustments. If you are going to live entirely in a PowerShell v3 world, fantastic! Go forth and spread the news. But perhaps you are…
Counting Users by OU with PowerShell
I’ve been following a discussion thread in the PowerShell forum at ScriptingAnswers.com. The post is about counting the number of users in an OU. Well that sounds like fun. We got him started using the Quest AD cmdlets. I thought I’d share some of the code I posted. The test code he is posting is…
Event Log Morning Report
The Morning Report script I published earlier this yeas was quite popular. One of the changes I made in it was to skip getting event log entries to speed up the overall process. But I received an inquiry today about how to create the report with only event log information. The only way really is…
Get Total Number of Week Days
Recently I was asked about a way to calculate the number of week days between two dates. It is simple enough to get the total days by subtracting two dates and then using the resulting TimeSpan object. But what if you want to skip counting Saturday and Sunday? As far as I can tell there…
Friday Fun PowerShell Crypto
I’m a big fan of codes, ciphers and secret messages. I obviously am a big PowerShell fan as well. So why not mash these things together? Today’s Friday Fun is a PowerShell module I call PSCode. The module contains a few functions for encoding and decoding text. Now, before you get too excited, these won’t…
Fun with PSDrive Locations
A PowerShell PSDrive is a mapping between a PowerShell provider and a resource. The majority of our work is done in a file system PSDrive that corresponds to a file system drive. Let me show you a little trick that might come in handy with a PSDrive. My “trick” should apply to just about any…
PowerShell Pivot Tables
I was working on a question in the Ask Don and Jeff forum about multidimensional arrays. The ultimate goal of sorts was to create an HTML report that contained in essence a pivot table. This device allows you to slice and dice data so that you can identify trends or patterns. In PowerShell, there aren’t…
Friday Fun: Expand Environmental Variables in PowerShell Strings
This week I was working on a project that involved using the %PATH% environmental variable. The challenge was that I have some entries that look like this: %SystemRoot%\system32\WindowsPowerShell\v1.0\. When I try to use that path in PowerShell, it complains because it doesn’t expand %SystemRoot%. What I needed was a way to replace it with the…
Find Required Services with PowerShell
Here’s a little PowerShell tidbit to get the status of all the required services. That is, the services that other services depend upon. When using Get-Service, this is the RequiredServices property which will be a collection of service objects. get-service | where {$_.status -eq “running”} | select -expand RequiredServices I’m intentionally omitting and results so…
Get ACL Information with PowerShell
I got a question in the “Ask Don and Jeff” forum on PowerShell.com that intrigued me. The issue was working with the results of the Get-ACL cmdlet. The resulting object includes a property called Access which is a collection of access rule objects. Assuming you are using this with the file system, these are System.Security.AccessControl.FileSystemAccessRule…
TechEd 2012 Slides and Demos
At TechEd North America in Orlando, I presented a great session on Group Policy and Windows PowerShell. The session was entitled Group Policy Reporting and Analysis with Windows PowerShell. I co-presented with Group Policy MVP and guru Jeremy Moskowitz. Jeremy played the part of the “pointy-haired” boss, posing questions about Group Policy such as finding…