Skip to content

Instantly share code, notes, and snippets.

@matt40k
Created May 27, 2015 21:34
Show Gist options
  • Save matt40k/ea5eed1780337daec0c8 to your computer and use it in GitHub Desktop.
Save matt40k/ea5eed1780337daec0c8 to your computer and use it in GitHub Desktop.
Clears the Jasper / iTrent cache on the web tier
$webserver = "localhost"
$environment = "dev"
$username = "user"
$password = "pass"
$url = 'http://' + $webserver + '/' + $enviroment + '_web/report/meta'
Function ClearCache($type)
{
return Invoke-WebRequest -Uri $url/$type -Method GET -Headers @{"Authorization" = "Basic "+[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($username+":"+$password ))}
}
# Clear cache
$reportresult = ClearCache -type 'reportcache?CLEAR=Clear+Cache'
$templateresult = ClearCache -type 'templatecache?CLEAR=Clear+Cache'
$imageresult = ClearCache -type 'imagescache?CLEAR=Clear+Cache'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment