I am attempting to redirect output of a Powershell script to a txt file.
In the Powershell window, I try:
.\script.ps1 > list.txt
But it does not help, all output still gets printed to the window.
I then tried:
.\script.ps1 >& list.txt
And got this error:
Missing file specification after redirection operator.
At line:1 char:21
+ .\script.ps1 > <<<< & list.txt
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingFileSpecification