While learning PowerShell, I executed the command ${$} by mistake and got an output like this:
PS C:\Users\myuser> Get-ChildItem Env: | Out-File -FilePath $home\env.txt
PS C:\Users\myuser> ${$}
$home\env.txt
First I believed it was something like $_, but doing ${$_} does not behave the same.
As per other samples I tried, it seems to retrieve the last argument from the previous command, but I'm not quite sure how it works or what it is actually doing.
I would appreciate an explanation or link to documentation/explanation.
PowerShell host information, if needed:
Name : ConsoleHost
Version : 5.1.17134.858
InstanceId : [Removed as I don't if can be shared careless]
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace