Start-Transcript D:\tmp\Transcript.txtThis will create a log called Transcript.txt that contains everything you did with powershell for that session. If you like, you can have it start up each time by setting this in your environment on powershell startup.
# Do some work
get-wmiobject win32_computersystem
Stop-Transcript
There are a few things to note with this:
- This will write over any previous sessions unless you set it up to append by using -Append $true in your Start-Transcript
- This works only in the command line and not in the ISE. I guess this was missed?
- This will log everything you type within the session
No comments:
Post a Comment