How To Check Any File Version | On Multiple Remote Machines, when there is a need to check a file version using the Powershell script? it’s easy if you have a single remote computer, but when you want to check it on many remote machines, it will be difficult, here I wrote a script that completes your task
In my case, I want to check the Google Chrome version using the PowerShell script. Let’s create a file name filepath.txt storing it in my local machine c:\temp\filepath.txt and store the path of that file in it, my file path: “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe”
First on a local machine, here is the script.
$fileversion = Get-ChildItem "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" Write-host $fileversion.basename $fileversion.VersionInfo.FileVersion
Output:
Chrome 79.0.3945.88
Let’s check it on Single Remote Machine
$file= Get-Content -Path "C:\temp\filepath.txt" $remote = $file.Replace(":","$") #add the server name or remote machine name in below path $fileversion = Get-ChildItem -Path "MyServer1\$remote" Write-host $fileversion.basename $fileversion.VersionInfo.FileVersion
Output:
Chrome 79.0.3945.88 On a remote machine as MyServer1
Let’s check it Multiple Remote Machines
we need to create one more file for storing the all the servers or multiple machines, I named it as Allserver.txt and saved it in my local machine c:\temp\Allserver.txt
$file= Get-Content -Path “C:\temp\filepath.txt” $remote = $file.Replace(“:”,”$”) $servers = Get-Content -Path “C:\temp\AllServer.txt” foreach ($server in $servers) { $fileversion = Get-ChildItem -Path “$server\$remote” Write-host $fileversion.basename $fileversion.VersionInfo.FileVersion }
Are you still looking more?
File Version report in Excel using PowerShell | Multiple Remote Machines.
When you want to check a file version on thousands of computers after upgrade or patch deployment, then we must need a Powershell script to validate and store data in an excel file on your local machine in C:\temp\file version result.csv.
Here is a script that captures the file version on multiple computers and writes into an excel CSV file
Thank you for visiting my site, for any scripts in these articles you are testing please make sure you have tested this script in our lower environment before you run in production.
Revision is also an important part of the file version.
To get this you need to access .FileVersionRaw or FileVersionPrivatePart