functions/dotnetver.ps1
function Get-DotnetVersion() { $def = get-content "$psscriptroot\dotnetver.cs" | out-string add-type -TypeDefinition $def $r = [DotNetVer]::GetVersionFromRegistry() @($r) | % { new-object pscustomobject -Property @{ Type = "Runtime"; Version = $_ } } | write-output if (test-path hklm:\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\FRAMEWORKSDK) { $sdk = get-item HKLM:\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\FrameworkSDK $sdk.Property | out-string | % { new-object pscustomobject -Property @{ Type = "SDK"; Version = $_ } } | write-output } if (test-path hklm:\SOFTWARE\Microsoft\VisualStudio\SxS\FRAMEWORKSDK) { $sdk = get-item HKLM:\SOFTWARE\Microsoft\VisualStudio\SxS\FrameworkSDK $sdk.Property | out-string | % { new-object pscustomobject -Property @{ Type = "SDK"; Version = $_ } } | write-output } } |