powershell - 为什么信息可以重定向但调试/详细不能?(默认情况下它们不会显示在主机上)
问题描述
下面的纠缠测试代码很好地说明了这个问题。
PowerShell.exe -nologo -noProfile -Command 'Write-information "information"' | Should -BeNullOrEmpty
PowerShell.exe -nologo -noProfile -Command 'Write-DeBug "DeBug"' | Should -BeNullOrEmpty
(Write-information "information" *>&1) | Should -BeOfType 'System.Management.Automation.InformationRecord'
(Write-DeBug "DeBug" *>&1) | Should -BeNullOrEmpty
与/write-information
相比,行为一致性差的原因是什么?write-DeBug
write-Verbose
看了帮助文档,没有找到答案,所以特地来这里求助。
解决方案
推荐阅读
- ant-design-pro - 翻译 Ant Design Pro Table 默认表的默认操作
- amazon-web-services - 无法将 google Dns 确认 Txt 记录添加到 Godaddy 的名称服务器
- .net - 在 API 和后端之间使用什么作为队列
- c# - 我可以在这个查询中使用 lastordefault 或 firstordefault 吗?怎么能?
- asp.net-mvc - 在 asp.net MVC 应用程序中展开行时,Kendo 嵌套网格绑定内部网格
- node.js - 避免统一请求标头中的 Content-Length
- c# - 如何过滤子集合,将 datetime 属性与另一个一加时间跨度值进行比较?
- javascript - 如何在html中按下按钮时触发Angular Mentions?
- reactjs - 如何在 react-chart-js-2 中使用填充 true 隐藏边框
- logging - GCP StackDriver RESTful API 没有记录,即使它返回 200