Problem:
Some times when performing bulk operations you would want to log the output of a powershell script to a text file, so you can examine the results and perhaps even investigate what went wrong.
Solution:
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
$ErrorActionPreference="SilentlyContinue"
Stop-Transcript | out-null
$ErrorActionPreference = "Continue"
Start-Transcript -path C:\Admin\SiteFeaturesoutput.txt -append
.
.
Your script goes here
.
.
Stop-Transcript
Some times when performing bulk operations you would want to log the output of a powershell script to a text file, so you can examine the results and perhaps even investigate what went wrong.
Solution:
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
$ErrorActionPreference="SilentlyContinue"
Stop-Transcript | out-null
$ErrorActionPreference = "Continue"
Start-Transcript -path C:\Admin\SiteFeaturesoutput.txt -append
.
.
Your script goes here
.
.
Stop-Transcript
No comments:
Post a Comment