Write output to a text file in PowerShell

后端 未结 3 1743
无人共我
无人共我 2020-12-01 05:00

I\'ve compared two files using the following code:

Compare-Object $(Get-Content c:\\user\\documents\\List1.txt) $(Get-Content c:\\user\\documents\\List2.txt)         


        
3条回答
  •  春和景丽
    2020-12-01 05:46

    Another way this could be accomplished is by using the Start-Transcript and Stop-Transcript commands, respectively before and after command execution. This would capture the entire session including commands.

    Start-Transcript

    Stop-Transcript

    For this particular case Out-File is probably your best bet though.

提交回复
热议问题