Skip to content

Instantly share code, notes, and snippets.

@iOnline247
Last active November 14, 2018 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iOnline247/6ccc398030e30b5410b37f5788700813 to your computer and use it in GitHub Desktop.
Save iOnline247/6ccc398030e30b5410b37f5788700813 to your computer and use it in GitHub Desktop.
Clears SPD's cache and restarts the program.
$spd = Get-Process | ? {$_.ProcessName -eq 'SPDESIGN'}
$spdPath = ${env:ProgramFiles(x86)} + '\Microsoft Office\Office15\SPDESIGN.EXE'
if ($spd -ne $null) {
$spdPath = if ($spd.Path) { $spd.Path } # Else { ${env:ProgramFiles(x86)} + '\Microsoft Office\Office15\SPDESIGN.EXE' }
$spd.Kill();
while(!$spd.HasExited) {
Start-Sleep 1000
}
}
Remove-Item "$($env:USERPROFILE)\AppData\Local\Microsoft\WebsiteCache\*" -Recurse -Force
Remove-Item "$($env:APPDATA)\Microsoft\Web Server Extensions\Cache\*" -Recurse -Force
Remove-Item "$($env:APPDATA)\Microsoft\SharePoint Designer\ProxyAssemblyCache\*" -Recurse -Force -ErrorAction SilentlyContinue
Start-Process $spdPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment