Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Adapting Powershell commands to query remote machines

$
0
0

I'm trying to determine which of my servers from a list (ex: servers.txt) have .NET 4.5 installed and what version of Powershell.  I have standalone commands which will tell me this on a single box -

PS D:\tools> Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client'
    Version       : 4.5.51641
    CBS           : 1
    TargetVersion : 4.0.0
    Install       : 1
    InstallPath   : C:\Windows\Microsoft.NET\Framework64\v4.0.30319\
    Servicing     : 0
    Release       : 378675
    PSPath        : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework
                    Setup\NDP\v4\Client
    PSParentPath  : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4
    PSChildName   : Client
    PSDrive       : HKLM
    PSProvider    : Microsoft.PowerShell.Core\Registry


Which shows at the top (Version) that it is indeed 4.5.  Is there a way to just display the Version field and the hostname (or computername) in a table format?  Also, same for the below command which gives you your version of Powershell -

    PS D:\tools> get-host |select-object version
   
    Version
    -------
    4.0

Thx!


Viewing all articles
Browse latest Browse all 6937

Trending Articles