powershell - $$、$?、$^ 在 powershell 中代表什么?

标签 powershell

在调试器中看到这些变量,但我不确定它们的作用。

最佳答案

  • $_ 当前管道对象;用于脚本 block 、过滤器、函数的处理子句、where-object、foreach-object 和 switch
  • $^ 包含输入到 shell 的最后一行的第一个标记
  • $$ 包含输入到 shell 的最后一行的最后一个标记
  • $? 包含最后一条语句的成功/失败状态

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

关于powershell - $$、$?、$^ 在 powershell 中代表什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4242161/

相关文章:

file - 如何复制某些文件(无文件夹层次结构),但不覆盖现有文件?

c# - 在 C# 中运行 Powershell 脚本

arrays - Powershell 字节数组到 INT

Powershell ..从网页中选择下拉菜单

powershell - 如何使用powershell提取publickeytoken?

powershell - 我可以在 Powershell 单行代码中选择属性和子属性吗

powershell - 如果特定证书文件 .crt 或 .cer 等已安装并处于事件状态

c# - 可以通过浏览器访问 WCF 服务,但不能通过 PowerShell 中的 GET

arrays - 为什么@($null) 是$false,而@($null, $null) 是$true?

visual-studio - 在Visual Studio中使用命令行