Last active
November 11, 2016 17:00
-
-
Save grant-killian/c734e7287f7c27182182ed9d17d29730 to your computer and use it in GitHub Desktop.
Sitecore perf counter installation
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
$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