Doing it this way I had to do some replace string in the results of fullnames. without it, it parsed out looking like {@fullname=\\blah\C$\windows\system32} causing the fileversion to fail.
Got a better idea, post it and let me know...
$a = Get-childitem -path "\\SomServer\C$\windows\system32" -recurse -include "Afd.sys","Dns.exe","Dnsperf.dll","Dnsperf.h","Dnsperf.ini","Mswsock.dll","Tcpip.sys","Tcpip6.sys","W03a3409.dll"|Select-Object fullname
$a=$a|ForEach-Object {$_ -replace "FullName=","" }
$a=$a|ForEach-Object {$_ -replace "@{",""}
$a=$a|ForEach-Object {$_ -replace "}",""}
$a|ForEach-Object{[System.Diagnostics.FileVersionInfo]::GetVersionInfo($_)|Select-Object FileName,ProductVersion}
No comments:
Post a Comment