FIND YOUR NEXT FEW LINES

Results for “Test-Path”

Small, practical examples. Search by task or narrow things down below.

1055 snippets foundClear filters
GitGetting Started

List paths saved in the latest commit

Git: List paths saved in the latest commit inside the disposable repository created by the input setup.

Git✓ Tested
PowerShellFiles & paths

Create a directory if needed

Ensure a directory exists before writing output.

New-Item✓ Tested
PowerShellFiles & paths

Build a portable file path

Combine directory and filename using the platform separator.

Join-Path✓ Tested
PowerShellGetting Started

Create a portable relative path

PowerShell: Create a portable relative path using PowerShell 7.

PowerShell✓ Tested
Linux CommandsFinding & selecting files

Extract a filename from a path

Linux Commands: Use basename with an explicit suffix when removing a known extension.

Linux Commands✓ Tested
Linux CommandsFinding & selecting files

Extract a parent directory from a path

Linux Commands: Use dirname without needing the path to exist.

Linux Commands✓ Tested
Bash ScriptsParameter expansion

Extract a parent path with parameter expansion

Bash Scripts: Percent removes the shortest matching slash-and-suffix portion.

Bash Scripts✓ Tested
GitMerging & replaying changes

List paths changed on a feature branch since its merge base

Git: A three-dot diff compares the branch tip with the common ancestor.

Git✓ Tested
GitMerging & replaying changes

List the paths with unresolved merge conflicts

Git: The U diff filter identifies unmerged entries without parsing human-readable status output.

Git✓ Tested
GitGetting Started

List tracked file paths

Git: List tracked file paths inside the disposable repository created by the input setup.

Git✓ Tested
Linux CommandsFinding & selecting files

Normalize a path without requiring it to exist

Linux Commands: Use GNU realpath -m and relative-to to normalize dot segments.

Linux Commands✓ Tested
GitGetting Started

Read history for one path

Git: Read history for one path inside the disposable repository created by the input setup.

Git✓ Tested