1

I am trying to flush cache here,

Add-PSSnapin Microsoft.Sharepoint.Powershell

$webApp = Get-SPWebApplication "https://portal2.zchech.com/"
[Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($webApp)
Write-Host "Flushed the BLOB cache for:" $webApp

Error

Unable to find type [Microsoft.SharePoint.Publishing.PublishingCache]. Make sure that the assembly that contains this type is loaded. At line:7 char:1 + [Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($webApp) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (Microsoft.Share...PublishingCache:TypeName) [], RuntimeException + FullyQualifiedErrorId : TypeNotFound

2
  • did you try to open the SharePoint Powershell instead of windows powershell...Start> all program> Microsoft SharePoint 2013 Products> SharePoint Management shell....RIght click and run as administrator
    – Waqas Sarwar MVP
    Aug 13, 2014 at 12:16
  • 1
    makes no difference as he is adding the dll, its the first line in his code
    – Ali Jafer
    Aug 13, 2014 at 12:21

1 Answer 1

0

1) make sure the account that your using has the right privlages to clear the cache.

2) is your blob enabled for the given web application?

goto webapps web.config and look for:

<BlobCache

if enabled=false than set it to true and then performe your powershell code.

3) run powershell as admin, right click powershell rather than double or single click and select run as administrator. This will open it up as admin level. If you have your code within a .ps1 (powershell) file than drag and drop the file into powershell and hit enter, it should then work!

http://technet.microsoft.com/en-us/library/gg277249(v=office.15).aspx

4
  • Thank You blob is not enabled in webcongidation and account has permissions rightly Aug 13, 2014 at 12:41
  • does your code work now?
    – Ali Jafer
    Aug 13, 2014 at 12:46
  • not working same error since now Aug 14, 2014 at 7:20
  • goto C:\Windows\Microsoft.NET\assembly\GAC_MSIL and make sure the dll exists?
    – Ali Jafer
    Aug 14, 2014 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.