NobGit
public imalexnord read

ms.open

Adds Mac "Open ." command to Windows

Languages

Repository composition by tracked source files.

PowerShell
PowerShell 100%
Create file Wiki Documentation
Clone
https://nobgit.com/user/imalexnord/ms.open.git
ssh://[email protected]:2222/user/imalexnord/ms.open.git
main default branch main protected 2 commits 7172ef4 Edit readme.md

README

MS.Open

MS.Open brings familiar macOS-style terminal conveniences to Windows.

It started with one command:

open .

It now includes a small collection of useful commands for opening files, working with paths, inspecting ports, serving local files, calculating hashes, and using the clipboard from PowerShell, Command Prompt, or Windows Terminal.

Commands

Command Purpose
open [path] Open a folder, file, or URL with its default Windows application
reveal <path> Open File Explorer and select a file
mkcd <folder> Create a directory and enter it
copypath [path] Copy the current or specified full path to the clipboard
reload Reload the current PowerShell profile
which <command> Show which command Windows or PowerShell will run
paths Print each PATH entry on its own row
serve [port] Serve the current directory over HTTP
ports Show listening TCP ports and their owning processes
killport <port> Stop the process listening on a port
sha256 <file> Calculate a SHA-256 hash
pbcopy Copy text or piped input to the clipboard
pbpaste Print clipboard text in the terminal
msopen Show the built-in command summary

mkcd and reload are PowerShell functions. The remaining commands work from PowerShell, Command Prompt, and Windows Terminal.

Installation

1. Download the repository

Download or clone this repository, then place it in a permanent location, for example:

C:\MS.Open

The folder should contain:

C:\MS.Open
├── bin
├── shell
├── install.ps1
└── uninstall.ps1

2. Run the installer

Open PowerShell inside the repository folder and run:

powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\install.ps1

The installer:

  • Adds C:\MS.Open\bin to your user PATH
  • Installs the mkcd and reload PowerShell functions
  • Configures both Windows PowerShell and PowerShell 7 profiles
  • Creates a backup before modifying an existing PowerShell profile
  • Does not require administrator privileges

3. Restart your terminal

Close and reopen PowerShell, Command Prompt, or Windows Terminal.

Verify the installation:

Get-Command open

You should see a result pointing to:

C:\MS.Open\bin\open.cmd

You can also run:

msopen

Usage

Open folders, files, and URLs

Open the current directory:

open .

Open the parent directory:

open ..

Open another folder:

open "C:\Projects"

Open a file with its default application:

open README.md

Open a website:

open https://nobgit.com

Reveal a file in File Explorer

reveal ".\build\release.zip"

For files, Explorer opens with the file selected. For folders, Explorer opens the folder.

Create and enter a directory

mkcd new-project

This command is available in PowerShell because changing the current directory must happen inside the active shell session.

Copy a path

Copy the current directory:

copypath

Copy the full path of a file or folder:

copypath ".\build\release.zip"

The resolved path is copied to the clipboard and printed in the terminal.

Reload the PowerShell profile

reload

This reloads the current PowerShell profile without requiring a new terminal window.

Find which command will run

which git
which open

This is especially useful when multiple versions of a command exist in PATH.

Inspect PATH

paths

Each PATH entry is printed separately, along with whether the location currently exists.

Serve the current directory

Serve the current folder on the default port, 8000:

serve

Use another port:

serve 3000

Then open:

http://127.0.0.1:3000/

The server listens on 127.0.0.1 only, so it is not exposed to other devices on the network.

Press Ctrl+C to stop it.

Show listening ports

ports

The output includes the address, port, process ID, and process name.

Stop the process using a port

killport 3000

MS.Open displays the owning process and asks for confirmation before stopping it.

Skip confirmation:

killport 3000 --force

Use --force carefully. The command refuses to terminate protected Windows system processes.

Calculate a SHA-256 hash

sha256 ".\release.zip"

Example output:

d2c7c9f1...  C:\Projects\release.zip

Clipboard commands

Copy text:

pbcopy "Hello from Windows"

Copy piped output:

Get-Content README.md | pbcopy

Paste clipboard text:

pbpaste

Updating

Pull or replace the repository files, then rerun:

powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\install.ps1

The installer safely refreshes the PATH entry and PowerShell profile integration without duplicating them.

Uninstall

Run:

powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\uninstall.ps1

The uninstaller:

  • Removes the MS.Open bin folder from your user PATH
  • Removes the MS.Open block from Windows PowerShell and PowerShell 7 profiles
  • Leaves the repository files in place

Restart the terminal after uninstalling. You can then delete the MS.Open folder.

Requirements

  • Windows 10 or Windows 11
  • Windows PowerShell 5.1 or PowerShell 7
  • Get-NetTCPConnection for the ports and killport commands

Security notes

  • serve binds only to 127.0.0.1
  • killport asks for confirmation unless --force is supplied
  • Installation modifies only the current user's PATH
  • Existing PowerShell profiles are backed up before modification

LICENSE

MIT License

Copyright (c) 2026 Alex Nord

Permission is hereby granted, free of charge, to any person obtaining a copy

of this software and associated documentation files (the "Software"), to deal

in the Software without restriction, including without limitation the rights

to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

copies of the Software, and to permit persons to whom the Software is

furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all

copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,

OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

SOFTWARE.