Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sitecore perf counter installation
$zipFileURI = ""
$stageFolder = "C:\staging"
if( !(test-path $stageFolder) )
mkdir $stageFolder
$downLoadZipPath = $stageFolder + "/"
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
start-sleep -Milliseconds 2000
start-sleep -Milliseconds 5000
taskkill /IM SitecoreCounters.exe
remove-item "$stageFolder\"
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