Each CMDLET has the common variables which contain. . .
-Verbose
-Debug
-WarningAction
-WarningVariable
-ErrorAction
-ErrorVariable
-OutVariable
-OutBuffer
You can specify Out Variable and then output the output of each command to a log file. This is how I like to do it. There may be better ways. Let me make a simple example.
Get-Service v* -OutVariable VService ## Note that my variable name “VService” does NOT have the dollar sign
$VService ## Now contains all your output
## At the end of your script you can simply use Out-File to send the content of each of your variables to a log file
$VService | Out-File -FilePath .\vservice.log -Append
you can do the same kind of thing with more than just output you can capture the warnings and errors with -WarningVariable and -ErrorVariable and maybe write those to a separate log.
-VERN