Pcornel
Windows · Files & Directories

Paths

Cheat sheet · https://pcornel.dk/topic.php?topic=2974

Back to the Topic

Answer

Windows paths can be absolute (C:\Users\pat\file.txt), relative (.\data), UNC (\\server\share\file) or device paths (\\?\C:\). They are case-insensitive and use backslashes, though forward slashes often work.

Remember

  • Windows paths are case-insensitive.
  • Relative paths resolve against the current working directory.
  • Paths with spaces must be quoted.

First checks

  • Get-ChildItem <path> -Force — contents including hidden
  • Test-Path <path> — exists?
  • Resolve-Path <path> — full path
  • Get-Item <path> | fl * — attributes and timestamps

Verify in this order

path string → resolved against drive/current directory → object

Where it usually breaks

First mismatch in target identity/version → persistent configuration/source of truth → provider/service/control plane → runtime/effective state → user/workload-visible result → event/log evidence; preserve identity/native error/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2974

Confirmation

Confirm action

Continue?