https://blog.netwrix.com/2018/10/04/powershell-variables-and-arrays/ $var1 = “Hello World” $var1 | Out-File HelloWorld.txt # 当前目录输出 $var2 = Get-Process $var2 | SELECT Name, Path | Export-Csv -Path D:\scripts\processes.csv #-Path可以省略。路径必须具有可写权限,否则会失败 $var2 | ConvertTo-HTML -Property Name, Path > D:\scripts\processes.html Get-Content c:\scripts\processes.csv # 读取文件内容,返回行数组。加-Raw参数返回整个文件内容字符串 (Get-ChildItem -Filter *.uproject) | Select-Object -First 1 | Get-Content -Raw | ConvertFrom-Json # 读取文件内容并构造一个ps里的json对象 |