Created
May 4, 2010 13:02
-
-
Save brunomlopes/389381 to your computer and use it in GitHub Desktop.
Simple script to update installed nhprof to latest downloaded version
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
if (Test-Path "env:ProgramFiles(x86)"){ | |
$outputdirectoryArg ="-oC:\Program Files (x86)\Nhibernate.Profiler" | |
}else{ | |
$outputdirectoryArg ="-oC:\Program Files\Nhibernate.Profiler" | |
} | |
if (@(get-process | where {$_.ProcessName -eq "nhprof"}).Count -gt 0){ | |
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | |
[System.Windows.Forms.MessageBox]::Show("Please stop nhprof before updating it") | |
}else{ | |
$zip = "C:\Program Files\7-Zip\7z.exe" | |
$latestNHibernate = @(Get-ChildItem e:\downloads\NHibernate* | sort-object -Property CreationTime -Descending )[0] | |
&$zip x $latestNHibernate $outputdirectoryArg -Y | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment