none
Powershell locate Edge Version, Can someone please take a look what is missing? Version column remains empty. RRS feed

  • Question

  • $devices= Get-Content -path "C:\Users\username\Desktop\testdeleteEdgequery\machines.txt"
    $Array = @()
    foreach($computername in $devices){
    #$productPath = $Env:WinDir + "\SystemApps\Microsoft.MicrosoftEdge_*\MicrosoftEdge.exe"
        #$productPath = "C:\Windows\SystemApps\Microsoft.MicrosoftEdge_*\MicrosoftEdge.exe"
    $productProperty = $null
        $productProperty = Invoke-command -computername $computername {Get-Item "C:\Windows\SystemApps\Microsoft.MicrosoftEdge_*\MicrosoftEdge.exe"}
    if($productProperty -ne $null){
    foreach ($instance in $productProperty){
    $verinfo = $instance.ProductVersion
    Write-Host $instance.ProductVersion
    }
    }else{
    Write-Host "Not find Edge."
    }

    $PCNAME = $computername
    $Result = @()
    $Result += New-Object PsObject -property @{
    'Machine' = $PCName
    'Version' = $verinfo
    }

    $Array += $Result
    $Array | export-csv -path "C:\versioninformation.csv" -NoTypeInformation


    }

    • Edited by JFelsen Friday, September 11, 2020 6:31 PM
    Friday, September 11, 2020 6:07 PM

All replies

  • You have to dig a little deeper:

    Get-Item "C:\Windows\SystemApps\Microsoft.MicrosoftEdge_*\MicrosoftEdge.exe" |
        Foreach-Object{
            $_.VersionInfo.ProductVersion
        }


    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    Friday, September 11, 2020 7:02 PM