-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FInd what's the current Net Framework installed
- Loading branch information
1 parent
a88884c
commit 2b151f2
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
function Get-ComputerNetFramework { | ||
<# | ||
.SYNOPSIS | ||
Get the installed .NET Framework version on a computer | ||
.DESCRIPTION | ||
Get the installed .NET Framework version on a computer | ||
.PARAMETER ComputerName | ||
The name of the computer to check the .NET Framework version on | ||
.EXAMPLE | ||
$DCs = Get-ADDomainController -Filter * -Server 'ad.evotec.xyz' | ||
Get-ComputerNetFramework -ComputerName $Dcs.HostName | Format-Table * | ||
.NOTES | ||
General notes | ||
#> | ||
[CmdletBinding()] | ||
param( | ||
[string[]] $ComputerName = $env:COMPUTERNAME | ||
) | ||
foreach ($Computer in $ComputerName) { | ||
$Output1 = Get-PSRegistry -ComputerName $Computer -RegistryPath 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client' | ||
#$Output2 = Get-PSRegistry -ComputerName $Computer -RegistryPath 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full' | ||
if ($Output1.PSError -eq $false) { | ||
[PSCustomObject] @{ | ||
ComputerName = $Computer | ||
NetFrameworkVersion = $Output1.Version | ||
NetFrameworkRelease = $Output1.Release | ||
Message = "" | ||
} | ||
} else { | ||
[PSCustomObject] @{ | ||
ComputerName = $Computer | ||
NetFrameworkVersion = 'Not Installed' | ||
NetFrameworkRelease = 'Not Installed' | ||
Message = $Output1.PSErrorMessage | ||
} | ||
} | ||
} | ||
} |