locked
listing IE versions RRS feed

  • Question

  • Hello..

    when i run the below script it gives me what i need but it adds extra data that i dont need.

    Comments  Company   Name   File  Build Part    File      Description  File Major Part  File  Minor  Part  File  Name File Private Part  File Version  Internal Name  Is Debug  Is Patched  Is Private  Build Is PreRelease  Is Special Build  Language LegalCopyright LegalTrademarks OriginalFilename PrivateBuild ProductBuildPart ProductMajorPart ProductMinorPart ProductName ProductPrivatePart ProductVersion SpecialBuild
























    these are the columns the csv shoots out. all i need is the computer name and product version.

    What can i add to this script to only have that info displayed

    Script:

    gc c:\temp\pc1.txt | foreach {[system.diagnostics.fileversioninfo]::GetVersionInfo("\\$_\C`$\program files\internet explorer\iexplore.exe") } |  export-csv c:\temp\ieversion1.csv

    thank you.

    Wednesday, January 22, 2014 4:54 PM

Answers

  • Perhaps something like this:


    get-content "C:\temp\pc1.txt" | foreach-object {
      new-object PSObject -property @{
        "ComputerName" = $_
        "IEVersion" = (get-item "\\$_\C$\Program Files\Internet Explorer\iexplore.exe").VersionInfo.FileVersion
      }
    }
    

    Bill

    • Marked as answer by KD627 Wednesday, January 22, 2014 5:42 PM
    Wednesday, January 22, 2014 5:04 PM

All replies

  • Perhaps something like this:


    get-content "C:\temp\pc1.txt" | foreach-object {
      new-object PSObject -property @{
        "ComputerName" = $_
        "IEVersion" = (get-item "\\$_\C$\Program Files\Internet Explorer\iexplore.exe").VersionInfo.FileVersion
      }
    }
    

    Bill

    • Marked as answer by KD627 Wednesday, January 22, 2014 5:42 PM
    Wednesday, January 22, 2014 5:04 PM
  • Bill.. thanks for the quick reply.. can i export this to csv?

    Wednesday, January 22, 2014 5:40 PM
  • got it.. thank you..

    | export-csv  .....

    Wednesday, January 22, 2014 5:42 PM