7
While learning PS I executed 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 seems to retrieve last argument from previous command, but not quite sure how it works or what is actually doing.
I will appreciate an explanation or link to doc/explanation.
Ps 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
Awesome ! Haven't read any until know for this "automatic variables", thank you. Now I understand why first google attempt didn't return something useful – Allende – 2020-02-25T22:30:54.617