Status Display_Name Name Stopped AJRouter AllJoyn Router Service Stopped ALG Application Layer Gateway Service Stopped AppIDSvc Application Identity Stopped AppMgmt Application Management Stopped AppReadiness App Readiness Stopped AppVClient Microsoft App-V Client Stopped AppXSvc AppX Deployment Service (AppXSVC) Stopped AxInstSV ActiveX Installer (AxInstSV) Stopped BDESVC BitLocker Drive Encryption Service Stopped BthHFSrv Bluetooth Handsfree Service Stopped bthserv Bluetooth Support Service Stopped cphs Intel(R) Content Protection HECI Service Stopped CscService Offline Files Stopped defragsvc Optimize drives Stopped DeviceAssociationService Device Association Service
我无法从命令直接将其转换为HTML,因为它是由于大量for
循环活动而产生的文件。
答案 0 :(得分:0)
从您提供的foo.txt(最后它是Get-Service的输出)我会使用:
Get-Service | where {$_.Status -eq 'Stopped'} | ConvertTo-Html
但这取决于你最初的目标是什么。
假设它是一个Tab分隔的Csv而不仅仅是一堆空格你可以使用:
Import-Csv -Delimiter "`t" -Path $PathToCSV | ConvertTo-Html
如果它只是一堆空格,我会回到我的代码中并创建一个格式正确的CSV或者首选的Powershell对象,而不是编写和读取Csv文件。