Skip to content

Instantly share code, notes, and snippets.

@eirikb

eirikb/sp.ps1 Secret

Created June 12, 2014 10:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eirikb/78df4e220782e7f9d9df to your computer and use it in GitHub Desktop.
Save eirikb/78df4e220782e7f9d9df to your computer and use it in GitHub Desktop.
Add-PSSnapin Microsoft.SharePoint.PowerShell
clear
Write-Host "Starting..."
Start-SPAssignment -Global | Out-Null
try{Start-Transcript -Path "C:\Log\log-$((Get-Date).ToString('yyyy-MM-dd')).txt" -Append}catch {}
// HERE BE CODE
try{Stop-Transcript}catch{}
Stop-SPAssignment -Global | Out-Null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment