PowerShell:上次执行结果是否有自动变量? [英] PowerShell: Is there an automatic variable for the last execution result?
本文介绍了PowerShell:上次执行结果是否有自动变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找与 Python 交互式 shell 的_"变量相当的功能.在 PowerShell 中,我想要这样的东西:
I'm looking for a feature comparable to Python interactive shell's "_" variable. In PowerShell I want something like this:
> Get-Something # this returns an object and display it to the output.
# Now I want to assign that object to some variable
> $anObj = ???
推荐答案
不,没有这样的自动变量.
No there is not automatic variable like that.
你必须这样做:
$output = Get-Something
$output
$anObj = $output
获取行为
这篇关于PowerShell:上次执行结果是否有自动变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文