PowerShell: Is there an automatic variable for the last execution result?

前端 未结 10 2061
名媛妹妹
名媛妹妹 2021-02-05 00:29

I\'m looking for a feature comparable to Python interactive shell\'s \"_\" variable. In PowerShell I want something like this:

> Get-Something # this returns          


        
10条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-05 00:59

    Use the module PowerShellCookbook and add a call to Add-ObjectCollector to your startup script

提交回复
热议问题