Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does $$, $?, $^ represent in powershell?

Tags:

powershell

Saw these variables in the debugger and I'm not sure what they do.

like image 232
Micah Avatar asked Nov 22 '10 03:11

Micah


1 Answers

  • $_ The current pipeline object; used in script blocks, filters, the process clause of functions, where-object, foreach-object and switch
  • $^ contains the first token of the last line input into the shell
  • $$ contains the last token of last line input into the shell
  • $? Contains the success/fail status of the last statement

Source: http://www.computerperformance.co.uk/powershell/powershell_variables.htm#%24Dollar_variables_

like image 198
Matt Ball Avatar answered Sep 18 '22 16:09

Matt Ball