Powershell - Automatic variables

Automatic variables are just like regular PowerShell variables, except:

  • They are read-only.
  • They are updated by the PowerShell runtime.
  • They contain useful data about the PowerShell environment and the state of your script.

No. Variable Name Description & Example

The last token of the last line executed.

PS C:\> get-date
Saturday, June 3, 2017 10:27:25 PM
PS: C:\> $$
PS C:\> (get-process).count
PS: C:\> $$

Report Error Show Variables

Ads by Google

Ask a question, send a comment, or report a problem - click here to contact me.

© Richard McGrath