Field notesAUWENSearch
Explore Systems
← Command indexPowerShell / test

Test-Path

Check whether a path exists.

Syntax

UPPERCASE words are placeholders to replace. Brackets in the syntax line describe optional arguments; do not type those brackets literally.

Test-Path -LiteralPath PATH

Example

Test-Path -LiteralPath ./note.txt -PathType Leaf

Expected result

True if an accessible file exists there; otherwise False.

Notes and traps

Existence checks and later file use are separate operations; the filesystem can change between them.

Related commands

Related tasks may need different flags and have different semantics. Check the entry before translating a command between shells.

Official reference ↗

Updated 13 September 2026. Examples describe the expected behavior; not every platform is available for execution testing.