powershell - 如何使用powershell以pdf格式保存任何powershell脚本的输出?

标签 powershell

代替:

Get-ChildItem -Path C:\ -Force | ConvertTo-Html -Body "<H2>C Drive Details</H2>" >> $OutFile

我想要 pdf 格式的输出而不是 html

最佳答案

如果你去这个网站http://www.powertheshell.com/modules/

您可以下载 PDFTools 模块并将内容提取到您的模块路径,然后 Import-Module PDFTools ,这会给你一个新的命令Out-PTSPDF您可以将结果传递给它。

@JamesC 是对的,没有“ native ”方法可以完成此操作。

关于powershell - 如何使用powershell以pdf格式保存任何powershell脚本的输出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53153591/

相关文章:

powershell - 您必须在 '/' 运算符的右侧提供一个值表达式

PowerShell Get-ChildItem 如何捕获异常

excel - 使用powershell查找word和excel文档的最后保存者

excel - Powershell脚本将txt转换为xlsx

node.js - 设置 SharePoint 框架开发环境时出现错误 "Your yo version is outdated"

regex - Select-String:仅当字符串前面没有特定字符时才匹配字符串

.Net 秒表和 Powershell

python - 在 key ID上链接Json数据以创建全新的Json文件

PowerShell:检测脚本函数中的错误

powershell - PS : Get index in an array list