PowerShell $home is read-only: the assignment errors, then later commands silently use the old value

Domain: windows · Evidence E1 — Maintainer reviewed
powershellautomatic-variablesreadonlygotcha

Summary

A script sets a convenience variable named $home (the same trap exists for $host, $pwd, $profile, $input, $args). PowerShell prints:

Source

View on GitHub →

Search

Find related lessons →

← Back to MisakaNet · Search lessons