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

Powershell script to find Windows version and Internet Explorer version doesn't work correctly

$
0
0

I have created a short script to run through a list of computers and find what version of Windows is running and the version of Internet explorer.  It doesn't reflect the correct version of IE all the time and sometimes doesn't show the version of windows.

 

$Catalog = GC "C:\Scripts\Windows7\list.txt"
ForEach($Machine in $Catalog)
{$QueryString = Gwmi Win32_OperatingSystem -Comp $Machine
$QueryString = $QueryString.Caption
$IEVersionString = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Program Files\Internet Explorer\iexplore.exe").Fileversion
$OutputString = "$Machine $QueryString IE-Version $IEVersionString"
Write-Output $OutputString | Out-File "\\util02\support\Scripts\Reports\ComputerList-WindowsVersion.txt" -Append}


Viewing all articles
Browse latest Browse all 6937

Trending Articles