• Stars
    star
    121
  • Rank 293,924 (Top 6 %)
  • Language
    PowerShell
  • License
    GNU General Publi...
  • Created almost 5 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PowerShell module that provides an extended "Open here" functionality for various terminals.

PowerShell "Open Here" Module

PowerShell module that enables "Open here" shortcuts functionality for Windows PowerShell, PowerShell Core, Windows Terminal, Bash and CMD.

Introduction

OpenHere is a PowerShell module for installation of shell shortcuts into the context menu (the right mouse button click or the menu key) for Microsoft Windows.

The shortcuts will open desired shell in the current location, e.g. for Windows PowerShell $PWD will be set to the location from which the shortcut was invoked.

Preview

Main features

  • Shortcut installation/removal for Windows PowerShell, Windows Terminal, CMD, PowerShell Core, Bash
  • Open here with non-elevated privileges shortcut.
  • Open here with elevated privileges shortcut.
  • Shortcut availability on directory, drive, directory background, user's desktop.
  • Default setting for easy-to-use.
  • Fully customizable shortcut names.
  • Fully customizable shortcut icon.
  • Capability of showing the shortcut only if the SHIFT key is pressed.
  • Rollback of all shell modifications.
  • Works offline.
  • Well documented.

Basic use

To install the OpenHere module, just type following command into your PowerShell session with elevated privileges.

Install-Module -Name OpenHere
Import-Module -Name OpenHere

Now, you can use the module as you wish. For shortcut installation:

Set-OpenHereShortcut -ShortcutType:WindowsPowerShell

Preview

For other shortcuts just type:

Set-OpenHereShortcut -ShortcutType:WindowsTerminal
Set-OpenHereShortcut -ShortcutType:CMD
Set-OpenHereShortcut -ShortcutType:PowerShellCore

For a custom shortcut & command names, fill parameters accordingly:

Set-OpenHereShortcut -ShortcutType:WindowsPowerShell -RootName 'Old PowerShell' -OpenHere 'I''m lazy' -OpenHereAsAdmin 'I''m lazy admin'

or the equivalent with the escape backtick:

Set-OpenHereShortcut -ShortcutType:WindowsPowerShell`
-RootName 'Old PowerShell' `
-OpenHere 'I''m lazy' `
-OpenHereAsAdmin 'I''m lazy admin

Preview

To remove the shortcut with any settings, just call:

Remove-OpenHereShortcut -ShortcutType:WindowsTerminal

For more details about setting/removing process, type:

Set-OpenHereShortcut -ShortcutType:WindowsTerminal -Verbose
Remove-OpenHereShortcut -ShortcutType:WindowsTerminal -Verbose

respectively.

For the default EXE icons as the shortcut icons, use -UseExeIcon:

Set-OpenHereShortcut -ShortcutType:WindowsTerminal -UseExeIcon

To show the Open Here shortcut only if the SHIFT key is pressed and the right mouse button is clicked, use -UseShift:

Set-OpenHereShortcut -ShortcutType:WindowsTerminal -UseShift

For more examples, type:

Get-Help Set-OpenHereShortcut -Examples

Notes

Windows Terminal doesn't responds to RunAs request from the context menu. This problem is a limitation of the UWP platform. A workaround has been implemented to support Windows Terminal shortcut with elevated privileges. A similar workaround had to be implemented for non-elevated Open here Windows Terminal shortcut to support scenarios when requests are invoked from RMB clicks on a directory or a drive letter.

FAQ

Are there any plans to extend the functionality of this module?

I consider this module feature complete. If you have some idea or suggestion, please open an issue. I definitely have a look on your suggestion.

Can I customize the shortcut icon?

By default, OpenHere module uses its own icons in shell context menus. If the -UseExeIcon switch is used when shortcut is created, the default icons are not generated. These default icons are written in %LOCALAPPDATA%\OpenHere\[ShellType]. Every shell has its own Icon.ico file in the corresponding subfolder. You can customize icons by overriding these Icon.ico files.

Can I override the names and setup?

Yes, just run Set-OpenHereShortcut with a new configuration.

Is the name limited to English?

No, the shortcut names supports Unicode and this is only limitation as I'm aware of.

Windows Command Prompt icon looks weird when Windows Black theme is turn on. What should I do?

You could either run Set-OpenHereShortcut again with -UseExeIcon or override the icon by some other ico file. Have a look at the previous FAQ about the shortcut icon customization for details.

Links

OpenHere module at PowerShell Gallery

Attributions

Get-Icon
CMD icon
PowerShell icon
PowerShell Core icon
WSLBash icon
PNG to icon online converter
PNG to base64 online converter

More Repositories

1

Stock-value

> A minimal, non-syntetic, clean architecture, modern C# 11 syntax, feature rich demo application for checking stock prices.
C#
71
star
2

PowerShell-GoogleImageSearch-Module

A PowerShell module to handle Google Image Search
PowerShell
8
star
3

PowerShell-Subtitle-Module

A PowerShell module to handle subtitles operations.
PowerShell
5
star
4

Autounattend-file-for-Windows-10

> A repository to track my autounattend files for Windows 10 installations.
5
star
5

Ultimate-Temperature-Library

.NET temperature library (NuGet)
C#
3
star
6

PowerShell-Choco-Module

> A PowerShell module for a simple Chocolatey installation for end users.
PowerShell
2
star
7

LABTech-WPF-lecture

> A repo for a WPF lecture done for LABTECH Ltd. 2023-02
C#
2
star
8

Talks

> A list of public technical talks and lectures.
PowerShell
1
star
9

Git-cheatsheet

> My personal Git cheatsheet.
1
star
10

C-CppCourse

> A source code for C/C++ course (all levels).
C++
1
star
11

PowerShell-pohledem-dotNET-programatora

Repositář pro přednášku PowerShell pohledem .NET programátora
PowerShell
1
star
12

Csharp-versus-Python-challenge

A challenge between Csharp and Python (Count all words in file).
C#
1
star
13

RTP-QoS-Tester

Real-time Transport Protocol Quality of Service Tester
C#
1
star
14

Generalni-Reditelstvi-Cel

> Poznámky z konzultace pro Generální ředitelství cel 07/2023.
1
star
15

TP-LINK-TL-WN722N-V1-driver-installation-Windows-10

> An automated installation of drivers for TP-LINK TL-WN722N V1 WiFi USB dongle for Windows 10.
PowerShell
1
star
16

Installation-of-PowerShell-Core-to-Turris-Omnia-LXC-Container

This repo is a step-by-step tutorial how to install PowerShell Core to Turris Omnia LXC container. It's aiming to Windows/PowerShell orientied users which not familiar with SSH/Bash enviroment and the official tutorials are driving them crazy.
1
star