Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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