Skip to content

Instantly share code, notes, and snippets.

@grant-killian
Last active November 11, 2016 17:00
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 grant-killian/c734e7287f7c27182182ed9d17d29730 to your computer and use it in GitHub Desktop.
Save grant-killian/c734e7287f7c27182182ed9d17d29730 to your computer and use it in GitHub Desktop.
Sitecore perf counter installation
$zipFileURI = "https://your.cdn.with.the.Sitecore.zip.resources/sitecorecounters%207.5.zip"
$stageFolder = "C:\staging"
if( !(test-path $stageFolder) )
{
mkdir $stageFolder
}
$downLoadZipPath = $stageFolder + "/SitecoreCounters.zip"
Invoke-WebRequest -Uri $zipFileURI -OutFile $downLoadZipPath
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory($downLoadZipPath, $stageFolder)
[System.IO.Directory]::SetCurrentDirectory($stageFolder + "\sitecorecounters 7.5")
Invoke-Item "$stageFolder\sitecorecounters 7.5\SitecoreCounters.exe"
start-sleep -Milliseconds 2000
$wshell = New-Object -ComObject wscript.shell
$wshell.AppActivate("SitecoreCounters.exe")
start-sleep -Milliseconds 2000
$wshell.SendKeys('~')
start-sleep -Milliseconds 5000
taskkill /IM SitecoreCounters.exe
remove-item "$stageFolder\SitecoreCounters.zip"
remove-item "$stageFolder\SitecoreCounters 7.5\*" -Recurse -force
Write-Output "Sitecore counter installation completed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment