---
title: "Open PowerShell in a Folder: A Step-by-Step Tutorial"
description: "Discover how to open PowerShell in a folder within Windows File Explorer with this easy-to-follow guide."
canonical: "https://adamtheautomator.com/windows-open-powershell-in-a-folder/"
---

# Open PowerShell in a Folder: A Step-by-Step Tutorial

> Discover how to open PowerShell in a folder within Windows File Explorer with this easy-to-follow guide.

Source: https://adamtheautomator.com/windows-open-powershell-in-a-folder/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Open PowerShell in a Folder: A Step-by-Step Tutorial](https://adamtheautomator.com/wp-content/uploads/2021/01/How-to-Open-PowerShell-in-a-Folder-in-Windows-Explorer.jpg)

# Open PowerShell in a Folder: A Step-by-Step Tutorial

[![](https://secure.gravatar.com/avatar/4147968aa2332aa682bcebf295e4e9d0eb2672dee3d9ae0523a00ac51e7d6017?s=192&d=mm&r=g)Bill Kindle](https://adamtheautomator.com/author/bill/)18 January 20214 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[PowerShell](/tag/powershell/)

Table of Contents

*   [Prerequisites](#h-prerequisites)
*   [Opening PowerShell via the Address Bar](#h-opening-powershell-via-the-address-bar)
*   [Opening PowerShell via the File Menu](#h-opening-powershell-via-the-file-menu)
*   [Building a Custom PowerShell Context Menu](#h-building-a-custom-powershell-context-menu)
*   [Testing Out the PowerShell Custom Menu Item](#h-testing-out-the-powershell-custom-menu-item)
*   [Next Steps](#h-next-steps)

Have you ever been in Windows File Explorer and just need to quickly open a PowerShell prompt in a folder? Do you want a _open powershell window here_ option or _open command window here_ option? If so, you’re in luck. In this tutorial, you’re going to learn how to open PowerShell in a specific folder when using Windows file explorer.

## Prerequisites

If you intend to follow along, be sure you have the following:

*   A Windows 10, Windows Server 2016, or Windows Server 2019 host. This tutorial will use Windows 10.
*   Logged in with a local account in the Administrators group or at least with rights to elevate to administrator, if necessary.

## Opening PowerShell via the Address Bar

File Explorer has an element at the top of the window that allows you to run programs just like if you were at a command line. You can invoke PowerShell from this address bar by pressing **CTRL**. From within File Explorer:

1.  Press and hold the **ALT** or **CTRL** key.
2.  Press the **D** or **L** key. This places the cursor in the address bar.
3.  Type `powershell` and press **Enter**. PowerShell will be opened in the current directory.

> _If you are logged in as the Administrator, then you will be in an administrative prompt for both PowerShell and Command Prompt._

The animated gif below is what you should see on your screen:

![Using ALT+D to open a PowerShell Window.](https://adamtheautomator.com/wp-content/uploads/2021/01/ALT_D_PowerShell.gif)

Using ALT+D to open a PowerShell Window.

## Opening PowerShell via the File Menu

Another handy way to open PowerShell in File Explorer is to use the file menu. Using the file menu, you could use the mouse or keyboard shortcut. Pressing ALT allows you to open the file menu. Within File Explorer:

1.  Press and hold the **ALT** key.
2.  Press the **F** key. This will open the file menu.
3.  Press the **S** key. This option will select _Open Windows PowerShell_ and will expand another sub-menu.
4.  Lastly, press the **R** key. PowerShell will open in the current directory.

> _If you need to open PowerShell as an administrator, use hit A instead of R._

**_Related: [How to Run PowerShell as Administrator](https://adamtheautomator.com/powershell-run-as-administrator/)_**

The animated gif below shows what the process should look like:

![Using ALT+F+S+R to open a regular PowerShell window in current directory.](https://adamtheautomator.com/wp-content/uploads/2021/01/ALT_F_S_R_PowerShell.gif)

Using ALT+F+S+R to open a _regular_ PowerShell window in current directory.

> _Holding the `ALT` key while navigating the context menu will display keys to use to jump through menus. The shortcut keys work in Windows 10, Windows Server 2016, and Windows Server 2019._

## Building a Custom PowerShell Context Menu

Now that you have all the shortcut keys in your toolbox, it’s time to dive a little deeper and build a context menu within File Explorer.

> _A context menu is the menu that you see when you right-click on an item in Windows._

Using a specially placed Windows registry key, you can create a custom context menu item to quickly open a PowerShell window when you right click inside of a folder. Let’s change that.

If you right click within a folder in File Explorer, you’ll see below that there is no context menu entry for opening PowerShell.

![No context menu entry for PowerShell.](https://adamtheautomator.com/wp-content/uploads/2021/01/Untitled-2021-01-05T092605.696.png)

No context menu entry for PowerShell.

However, if hold SHIFT key and _then_ right click in a folder, you’ll then see the context menu item below.

![Context menu option when using SHIFT+Right-Click.](https://adamtheautomator.com/wp-content/uploads/2021/01/Untitled-2021-01-05T092634.702.png)

Context menu option when using SHIFT+Right-Click.

Let’s build a custom context menu item that’ll allow you to open a PowerShell window _without_ holding Shift key.

To create a custom context menu item, you must create a few different Windows registry keys and values. These values, when created, will instantly create a custom context menu item.

Below are the following Windows registry keys and values necessary:

<table><tbody><tr><td class="has-text-align-left" data-align="left">Path</td><td class="has-text-align-left" data-align="left">Name</td><td class="has-text-align-left" data-align="left">Value</td><td class="has-text-align-left" data-align="left">Notes</td></tr><tr><td class="has-text-align-left" data-align="left">HKCR:\Directory\shell\powershellmenu</td><td class="has-text-align-left" data-align="left">(Default)</td><td class="has-text-align-left" data-align="left">Open PowerShell Here</td><td class="has-text-align-left" data-align="left"></td></tr><tr><td class="has-text-align-left" data-align="left">HKCR:\Directory\shell\powershellmenu\command</td><td class="has-text-align-left" data-align="left">(Default)</td><td class="has-text-align-left" data-align="left">C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command Set-Location -LiteralPath ‘%L’</td><td class="has-text-align-left" data-align="left"></td></tr><tr><td class="has-text-align-left" data-align="left">HKCR:\Directory\shell\runas</td><td class="has-text-align-left" data-align="left">(Default)</td><td class="has-text-align-left" data-align="left">Open PowerShell Here as Administrator</td><td class="has-text-align-left" data-align="left"></td></tr><tr><td class="has-text-align-left" data-align="left">HKCR:\Directory\shell\runas</td><td class="has-text-align-left" data-align="left">HasLUAShield</td><td class="has-text-align-left" data-align="left"></td><td class="has-text-align-left" data-align="left">This adds a built-in icon for elevated prompts</td></tr></tbody></table>

To add the custom context menu, you can [create the above keys and values manually](https://www.lifewire.com/how-to-add-change-delete-registry-keys-values-2625145#:~:text=Once%20you've%20located%20the,key%20and%20then%20press%20Enter) or you can use a PowerShell script to do the dirty work for you.

Below is a script you can use to quickly create all of the necessary keys and values in one shot.

```powershell
$Menu = 'Open PowerShell Here'
 $Command = "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'"
 $RunAsMenu = 'Open PowerShell Here as Administrator'
 HKCR doesn't exist by defualt in PSDrives, so you need to create it.
 New-PSDrive -PSProvider Registry -Root HKEY_CLASSES_ROOT -Name HKCR
 Now create the keys and values (non-admin)
 New-Item -Path HKCR:\Directory\shell -Name 'powershellmenu' -Force |
     Set-ItemProperty -Name '(Default)' -Value $Menu
 New-Item -Path HKCR:\Directory\shell\powershellmenu\command -Force |
     Set-ItemProperty -Name '(Default)' -Value $Command
 Now create the keys and values (admin)
 New-Item -Path HKCR:\Directory\shell -Name 'runas' -Force |
     Set-ItemProperty -Name '(Default)' -Value $RunAsMenu
     # This adds a built-in icon for elevated prompts
     New-ItemProperty -Path HKCR:\Directory\shell\runas\ -Name HasLUAShield -Value ''
 New-Item -Path HKCR:\Directory\shell\runas\command -Force |
     Set-ItemProperty -Name '(Default)' -Value $Command
```

When you’ve finished creating the registry keys and values, you should see a value that looks like below:

![Complete context menu registry key entry for open powershell here option.](https://adamtheautomator.com/wp-content/uploads/2021/01/Untitled-2021-01-05T093351.414.png)

Complete context menu registry key entry for open powershell here option.

## Testing Out the PowerShell Custom Menu Item

Once complete, close the Windows registry editor if you have it open and right click on any folder within File Explorer. You should now see the new Open PowerShell Here context menu entry you created!

![Open PowerShell Here context menu](https://adamtheautomator.com/wp-content/uploads/2021/01/Untitled-2021-01-05T093419.076.png)

Open PowerShell Here context menu

Below is the new context menu _Open PowerShell Here_ option in action:

![Context menu Open PowerShell Here option in action.](https://adamtheautomator.com/wp-content/uploads/2021/01/context_menu_Open_PowerShell_Here.gif)

Context menu _Open PowerShell Here_ option in action.

## Next Steps

Now that you know all the ways to open a PowerShell window within File Explorer, what else can you add to your context menus to increase your file explorer productivity? Maybe you can add a _Open Command Prompt Here_ or experiment with opening different PowerShell profiles using context menus. Try adding an icon to the context menu even!

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fwindows-open-powershell-in-a-folder%2F&text=Open%20PowerShell%20in%20a%20Folder%3A%20A%20Step-by-Step%20Tutorial)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fwindows-open-powershell-in-a-folder%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fwindows-open-powershell-in-a-folder%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2026/06/26995-troubleshoot-dns-issues-powershell-codex.webp)

### [Troubleshoot DNS Issues with PowerShell](/troubleshoot-dns-issues-powershell/)

Troubleshoot DNS issues with PowerShell by testing name resolution, DNS client settings, cache entries, and network connectivity in a repeatable workflow.

![](https://adamtheautomator.com/wp-content/uploads/2025/10/image_2025-10-24_095322075.png)

### [Migrating from PowerShell 6 to 7.5: Breaking Changes/New Features](/migrating-powershell-6-to-7-5/)

Migrate from PowerShell Core 6 to 7.5: breaking changes, features, and testing tips.

![](https://adamtheautomator.com/wp-content/uploads/2025/06/featured-image-6.png)

### [How to Add Timeouts to Pester Tests with PowerShell Runspaces](/pester-test-timeout-runspaces/)

Prevent Pester tests from hanging indefinitely using PowerShell runspaces. Learn to handle variable scoping, module loading, TestDrive access, and stream capture challenges with timeout protection.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
