How to check Net version and IIS version on tentacle before/at deploy?

Is it possible to have the tentacle health check (or a deployment step) test for the currently installed .Net version? The same would apply for IIS version number. It wasted a lot of time today to see that my server upgrade exe powershell script failed with error code -2146232576 (very helpful error code) on one tentacle. After adding this bit of powershell it gave me a build number which I could then derive on MSDN to be Net version 4.5.1 (rather than the 4.5.2 wich was needed).

Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse | Get-ItemProperty -name Version,Release -EA 0 | Where { $_.PSChildName -match '^(?!S)\p{L}'} | Select PSChildName, Version, Release

So now at least I have the .Net build numbers in my logfile as reference in the log if it fails. However, do feel that this could be made easier/automatic. So is there a way to check the the tentacle environment .Net version which I’ve missed? I’m fairly new to Octopus and not very skilled in powershell (the ps script above is not my own ;-).

Hi,

Thanks for reaching out. The only way to get this would be using a script. I’ve gathered the first results I could find on google and made this snippet for you:

function Get-DotNETVersions{

$dotnetversions = Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
Get-ItemProperty -name Version,Release -EA 0 | Where { $_.PSChildName -match '^(?!S)\p{L}'} | Select PSChildName, Version, Release

$dotnetversions
}

Function Get-IISVersion{
    $iisversion = get-itemproperty HKLM:\SOFTWARE\Microsoft\InetStp\  | select -ExpandProperty versionstring 
    $iisversion
}

Write-output "IIS version installed on $($env:COMPUTERNAME): " (Get-IISVersion)

Write-Output ".NET versions installed on $($env:COMPUTERNAME): "

Get-DotNETVersions

Hope that helps!
Dalmiro

Thanks for that bit of poweshell script Dalmiro, it clearly lists the .net version number and installed IIS version which is helpful. I gather that there is no way in which we could incorporate this bit of script in the health check of each tentacle though? Could envisage that you would want to monitor certain key aspects of your remote machines, and if we could plug in scripts like this then we could write our own additions. That might be more of a change request though. Will experiment a bit more with powershell, which might be worth learning after all :wink:

Thanks for the excellent support!
Theo

Hi Theo,

Thanks for reaching out. At the current version is not possible to tweak the health check script, but there’s already a uservoice sugestion gaining momentum for it: http://octopusdeploy.uservoice.com/forums/170787-general/suggestions/4328055-scriptable-tentacle-health-check . Try to leave some votes and why not a comment on it.

Its definitely worth learning Powershell. Tell your manager to buy this book for your team if you are planning on learning a bit more about it -> https://www.manning.com/books/learn-windows-powershell-in-a-month-of-lunches-second-edition

Dalmiro

Hi Dalmiro,

Thanks for this helpful feedback, have added my votes and feedback to that item and will surely check out the powershell book.

By the way, your job might be discouraging at times (with all those newbies) but you are making a great difference! Keep up the good work :slight_smile:

Highest Regards,
Theo

Thanks for the kind words! Glad to hear We’re making a difference here :slight_smile: