# Run It from Anywhere

A script that reads its files from $PSScriptRoot works from any folder; a Scripts folder on your PATH lets you run it by name, pwsh -File starts it from outside PowerShell, and a desktop shortcut with pwsh -File in its target runs it with a double-click.

![Cheat sheet for the lesson Run It from Anywhere: A script that reads its files from $PSScriptRoot works from any folder; a Scripts folder on your PATH lets you run it by name, pwsh -File starts it from outside PowerShell, and a desktop shortcut with pwsh -File in its target runs it with a…](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/a3efb167721648559358c2e8b2803cc6.webp)

- Category: PowerShell
- Level: Apprentice
- Tags: path, powershell, psscriptroot, pwsh, shortcut
- Updated: November 10, 2026

Source: https://www.ask-codey.com/cheat-sheets/powershell-run-from-anywhere-cheat-sheet
