Me using this script to find PSP version on all
my servers but problem is that it show me same PSP version for all servers
when i checked manually all severs have different version.
in listofcomputers i have host names of servers
foreach ($computer in (Get-Content -Path C:\listofcomputer.txt)) {
Get-Item -Path "C:\Windows\System32\CpqMgmt\cqmgstor\cqmgstor.exe" |
ForEach-Object {
New-Object -TypeName PSCustomObject -Property @{
FileName = $_.FullName
FileVersion = $_.VersionInfo.FileVersion
ProductVersion = $_.VersionInfo.ProductVersion
Computer = $Computer
} | Select-Object -Property Computer,FileName,FileVersion,ProductVersion |Out-File C:\PSP.txt -Append -Encoding ascii}
}