Tag Archives: Show-PSDriveMenu

Show-PSDriveMenu Revisited


Welcome to the 299th post on tommymaynard.com. It’s countdown to 300!


Back on August 14, 2018, I introduced a new utility I had written and shared via the PowerShell Gallery. It was called Show-PSDriveMenu and here’s a quick example of its usage. It lists the currently available drives, includes a marker to indicate the current drive, and allows you to change drives by entering a corresponding drive number.

The problem with the 1.0 version is that when Show-PSDriveMenu was invoked the initial time, it wouldn’t include the marker to indicate the current drive. Well, now it’s included on all the invocations, to include the very first one.

The updated script be downloaded from the PowerShell Gallery using the Install-Script command, included in the PowerShellGet module, using the below example. Be sure to include the Force parameter if you installed the 1.0 version, in order that the older version is replaced by the newer version.

PS > Install-Script -Name Show-PSDriveMenu -Scope CurrentUser

As mentioned in the original post, if you want this function (downloaded as a script file from the PowerShell Gallery), to load each time you start PowerShell, then add one of the two lines of code below to your profile script. The first is for Windows PowerShell (version 5.1 and earlier), and the second is for PowerShell Core (version 6.0 and later).

. $env:USERPROFILE\Documents\WindowsPowerShell\Scripts\Show-PSDriveMenu.ps1
. $env:USERPROFILE\Documents\PowerShell\Scripts\Show-PSDriveMenu.ps1

It’s Available: Show-PSDriveMenu


Welcome to the 295th post on tommymaynard.com. It’s countdown to 300!


Update: There’s a updated post here.

It was only yesterday that I shared something I was writing in PowerShell. It was my take on Get-PSDrive that included a built-in way to change locations, within the file system, by entering the number that corresponds to a drive location. Take a look at the Tweet (and yes, I’m aware of my misspelling).

There was definitely some interest on Twitter. Because of that, I set out to correct at least a couple errors that needed a fix. For now, it’s up and available on the PowerShell Gallery at https://www.powershellgallery.com/packages/Show-PSDriveMenu/1.0/DisplayScript. Use the PowerShellGet, Install-Script function to install it.

PS > Install-Script -Name Show-PSDriveMenu -Scope CurrentUser

Here’s an image from the ConsoleHost. There’s a small visual change that’s been added since the above Tweet. Numeric values with one digit (1-9) have an extra space in front of the digit in order that everything lines up well.

Update: It appears that there may be a problem at first launch, as the marker that indicates the current drive (>), doesn’t appear. It does, however, on subsequent uses. I’ll have to take a look at that at some point and see if it can be isolated and resolved. If you catch it (and, seriously there’s a minimal amount of code in this function), feel free to let me know.

Update: If you want this function (downloaded as a script file from the PowerShell Gallery), to load each time you start PowerShell, then add one of the two lines of code below. The first is for Windows PowerShell (version 5.1 and earlier), and the second is for PowerShell Core (version 6.0 and later). You know, when Windows PowerShell and PowerShell began to mean different things.

. $env:USERPROFILE\Documents\WindowsPowerShell\Scripts\Show-PSDriveMenu.ps1
. $env:USERPROFILE\Documents\PowerShell\Scripts\Show-PSDriveMenu.ps1