Link to home
Start Free TrialLog in
Avatar of mjm21
mjm21Flag for United States of America

asked on

Powershell Script to get what.NET Versions are installed on several remote servers

Powershell Script to get what .NET Versions are installed on several remote servers and exports the results to a .csv file
Avatar of Joshua Grantom
Joshua Grantom
Flag of United States of America image

There you go.

$computers = Get-Content "C:\remotecomputers.txt"
foreach ($computer in $computers) {
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
Get-ItemProperty -name Version -EA 0 |
Where { $_.PSChildName -match '^(?!S)\p{L}'} |
Select PSChildName, Version | Select @{Name='Computer Name';Expression={$computer}},PSChildName,Version | Export-CSV "C:\NetVersions.csv" -Append -nti
}

Open in new window

Avatar of mjm21

ASKER

Cool!  But getting this error:

Export-Csv : A parameter cannot be found that matches parameter name 'Append'.
At line:6 char:146
+ Select PSChildName, Version | Select @{Name='Computer Name';Expression={$computer}},PSChildName,Version | E
xport-CSV "C:\NetVersions.csv" -Append <<<<  -nti
    + CategoryInfo          : InvalidArgument: (:) [Export-Csv], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.ExportCsvCommand
ASKER CERTIFIED SOLUTION
Avatar of Joshua Grantom
Joshua Grantom
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Wow that was 2 years ago, any way I can modify that Qlemo?