我试图写一个文件结果:
$installedPrograms = Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate
它根本不起作用。我尝试过使用:
$installedPrograms >> "installedProgram.txt"
和
$installedPrograms | Out-File "installedPrograms.txt"
和
$stream = [System.IO.StreamWriter] "installedPrograms.txt"
1..10000|%
{
$stream.WriteLine($installedPrograms)
}
$stream.Close();
以上都没有工作......
答案 0 :(得分:0)
在csv中可能更好
$installedPrograms = Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate
$installedPrograms | export-csv installedPrograms.csv -notypeinformation