gpt4 book ai didi

powershell - 如何从PowerShell格式列表获取输出作为字符串?

转载 作者:行者123 更新时间:2023-12-03 12:10:50 28 4
gpt4 key购买 nike

我想将Format-List命令的输出写入事件日志,因此我需要将其作为字符串。

有没有一种通用的方法可以执行此操作,而又不取决于要格式化的内容?

最佳答案

使用Out-String cmdlet:

... | Format-List | Out-String

关于powershell - 如何从PowerShell格式列表获取输出作为字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17131988/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com