PowerShell automatic variables are predefined variables that return information about the PowerShell environment, the current operation, and recent events. They're called automatic because they're maintained by PowerShell itself and update automatically as you use the shell. A few examples:
Error– A list of the most recent errors where$Error[0]is the last error.$MyInvocation– Information about the current script or command, such as the name, parameters and parameter values.$_– Contains the current object in pipeline input
There are many more. In general, these variables cannot be set or modified directly by the user, and they're useful because they exist automatically and reliably to provide additional execution context in scripts and sessions.
For a complete list, see about_Automatic_Variables.
Interestingly, it's possible to create your own variables that are almost as automatic. That is, it's possible to define additional variables that calculate their value each time they're invoked, and even make them ReadOnly or AllScope, as long as you're careful.