I'm currently using the Out-File cmdlet, like so:
PS> Some-Cmdlet -someswitch | Out-File -filepath .\somefile.txt
It works great.
Is there anyway that I can actually get the command line itself to print to the same file before the output?
In other words, when I open somefile.txt
I want to see the following:
Some-Cmdlet -someswitch | Out-File -filepath .\somefile.txt
OUTPUT
OUTPUT
OUTPUT
etc.
I think you're looking for
start-transcript
:So you'd want to do: