Last active
November 14, 2018 18:14
-
-
Save iOnline247/6ccc398030e30b5410b37f5788700813 to your computer and use it in GitHub Desktop.
Clears SPD's cache and restarts the program.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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