April 2012 - Power Tips

Share |

Join PowerShell.com!
Subscribe to Feed

PowerShell eBook
Sign up for
Your PowerTip of the Day:

Award-winning PowerShellPlus


Admin Guide to PowerShell Remoting


Mastering PowerShell eBook

Welcome to the archive of tips delivered through Tobias' Tip of the Day RSS Feed and Your Power Tip of the Day email. Subscribe in the sidebar to get the latest tips!

Sort by: Most Recent | Most Viewed | Most Commented
  • Making Names Unique

    To make a list of items or names unique, you could use grouping and then, when a group has more than one item, append a numbered suffix to these items. Here's a simple example: function Convert - Unique ( $list ) { $list | Group-Object | ForEach-Object...
  • Home-Made Driver Query Tool

    Some months ago we introduced to you the driverquery.exe tool and how to convert its output to PowerShell objects. Here's now an amazing function that turns this command-line tool into a graphical tool that lists drivers from both local and remote...
  • Checking Text Ending with Wildcards

    In a previous tip you learned how to use the string method EndsWith() to check whether a text ends with certain characters. This method does not accept wildcards, though. So to check text endings for patterns, try this approach instead: PS > "Account123"...
  • Checking if a Text Ends with Certain Characters

    You can always use the String method EndsWith(). Just make sure you convert the text to lower-case first to avoid case-sensitive comparison. This will check whether the file name ends with '.pdf': PS > "somefile.PdF" . toLower ()...
  • Counting Log Activity Based On Product Install

    In a previous tip you learned how to use Group-Object to analyze text-based log files. Here's a refined snippet. It will count on which days your Windows box received the most updates: Get-Content $env:windir\windowsupdate.log | Where-Object { $_...
  • Counting Log Activity

    Did you know that Group-Object can analyze text-based log files for you? Here's sample code that tells you how many log entries on a given day a log file contains: Get-Content $env:windir\windowsupdate.log | Group-Object { $_ . SubString ( 0 , 10...
Copyright 2012 PowerShell.com. All rights reserved.