Skip to content
Archive of entries posted by

A Script to Find All Aliases for a Cmdlet

I’ve mentioned before that I love PowerShell, but I’m still trying to commit enough Cmdlets and aliases to memory that I can be immediately productive from a Powershell prompt without having to have a browser window open to the Powershell documentation on another monitor. Several of the Cmdlets may also be referenced through one or more aliases, and it’s rather cumbersome to discover what aliases are defined for a given Cmdlet.

I stumbled onto a bit of code that will find all aliases for a given Cmdlet which I put it into a script named Find-Alias. That will let me type the following:

PS C:\>Find-Alias Get-ChildItem

CommandType     Name                     Definition
-----------     ----                     ----------
Alias           dir                      Get-ChildItem
Alias           gci                      Get-ChildItem
Alias           ls                       Get-ChildItem

Here is the script code:

param(
    [Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true, ValueFromPipeLineByPropertyName=$true)]
    [string]$Command)

Process
{
  get-alias | where-object {$_.Definition -match $Command}
}
Share

New Accelerated C++ Chapter!

I’ve finally started adding solutions for chapter 3 of Accelerated C++. Currently only the first three all exercises in chapter 3 are complete. I’ll continue to strive to add new solutions on a regular basis, at least two a week.

The new solutions were rather involved, so please let me know if I can improve the solutions in any way.

Update: Now I’m part of the way into chapter 4. It’s really starting to roll now.

Share

Accelerated C++ Solutions Moved to WordPress

I’ve finally moved my old solutions to the Accelerated C++ solutions to a new set of pages that I can edit with WordPress. There’s now a link and menu in the menu bar on this page.

They still only go through chapter 2, but now that they’re moved I can start adding new solutions again. Stay tuned.

Share

A Keyword I’d Like To See in C#

Although I use C# more and more these days, I still consider myself primarily a C++ developer. C# has a few really neat language features that are just now being added to C++ (like lambdas), but I still find C++ to be more expressive, with terser syntax, than C#.

One example of this is deterministic disposal in C#. For classes that implement IDispose this is accomplished with the using statement. One example from MSDN follows:

using (Font font1 = new Font("Arial", 10.0f))
{
    byte charset = font1.GdiCharSet;
}

Seems simple enough, right? What could I possibly have to complain about in that code?

Continue reading ‘A Keyword I’d Like To See in C#’ »

Share

Hyphens. Use them. They’re important.

I hate to follow one rant with another one, but I’ve got to get this off my chest. Look at these pictures:

A high-school student

This is a high-school student.

A high school student.

This is a high school student.

See the difference? The first picture is of a high-school student (my elder daughter, Madeline). The second picture is of a high school student (Sean Penn as Jeff Spicoli in Fast Times at Ridgemont High). That’s the difference a hyphen can make in the meaning of a sentence. The first picture depicts a typical 16-year-old girl; the second picture shows the kind of guy she won’t be allowed to date.

American English is really lenient about the use of hyphens in compound adjectives, but I’m seeing a lot more sentences lately where the missing hyphen makes a difference in the meaning of the sentence.

(I’m pretty sure there are some grammar mistakes in this post. Fire away!)

Share

Please Stop Holding Project Status Meetings

(I’ve also posted this same article on Code Project.)

Before I launch into the body of this essay, let me say that I think meetings are wonderful things. I’ll even go so far as to say that people in my field, software development, probably don’t have enough meetings. I have to qualify these opinions, however, by saying that they only apply to the right kinds of meetings. Regularly scheduled project status meetings that involve an entire team are definitely the wrong kind of meeting. They provide very little useful communication, and they kill productivity. There are better ways to accomplish the purpose of status meetings without actually having them.

Continue reading ‘Please Stop Holding Project Status Meetings’ »

Share

Supporting the Ribbon and Menus

(I’ve posted a version of this article on Code Project.)

I’ve finally come back to Ripsaw, in a round-about way. I’ve started working on the client application again as a way to investigate the Windows Ribbon Framework. Originally, I had planned to create a Ribbon implementation for Windows 7 and later, and a menu-based implementation for earlier Windows versions, or for users that preferred a menu over the Ribbon.

Scratch Ribbon Project

After I played around with the API a while, I realized it would be fairly simple to support both the Ribbon and the traditional menu in one executable. In this article I’ll describe a sample app that I put together that shows how to accomplish support for both command-selection methods.

(Download the source code)
(Download the executable)
(Download the Visual C++ 2010 Redistributable)

Continue reading ‘Supporting the Ribbon and Menus’ »

Share

GWA Band: NATIONAL CHAMPIONS!

Congratulations to the George Walton Academy Marching Bulldog Band for winning first place at the USSBA National Championships in Annapolis, MD in the Group VI division.

The band won caption awards for overall effect, music, and percussion, and the color guard (of which my daughter Madeline is a part) placed second in Group VI. This is an amazing accomplishment that caps a fantastic year for the band. They have worked incredibly hard this season, and I’m so proud of all of them.

Here is a video of this season’s show from an earlier competition, shot by another band parent:

Share

Why Post from Powershell?

Because I can. Everyone knows the cool kids do everything from a command line.

Share

Posting from Powershell!

This entry was created and uploaded from a Powershell Cmdlet that I wrote to interact with the WordPress API. I’m creating a full set of Cmdlets for each of the XML-RPC methods in the API. When they’re done, I’ll post the code.

Share