![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Retrieving VersionInfo for a list of file I am trying to retrieve the file version information for a list of files (unsuccessfully). The objective is to find the version information on a list of file in a single user-defined path. In this sample, I'm attempting to retrieve the version of these files in the c:\windows\system32 directory, where installpath is the directory where the files are found. Should I be using foreach to repeat steps for each file in the list? #------------Begin script sample param( [string] $installpath = $(Throw "installpath required.") #required parameter ) $files = $installpath + "\dfrgsnap.dll",$installpath + "\dfrgui.dll",$installpath + "\dfsshlex.dll" dir $files | format-list VersionInfo #------------End script sample Regards, Pete Zerger, MCSE(Messaging) | MCTS(SQL 2005) | MCTS(Opsmgr) | MVP - Opsmgr URL:http://www.systemcenterforum.org User Group: http://www.systemcenterusergroup.com MP Catalog: http://www.systemcenterforum.org/mps |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Retrieving VersionInfo for a list of file Hello Pete, Enclose the file paths with (): $files = ($installpath + "\dfrgsnap.dll"),($installpath + "\dfrgui.dll"),($installpath + "\dfsshlex.dll") Or let powershell expand $installpath: $files = "$installpath\dfrgsnap.dll","$installpath\dfrgui.dll","$installpath\dfsshlex.dll" --- Shay Levy Windows PowerShell MVP http://blogs.microsoft.co.il/blogs/ScriptFanatic PowerShell Toolbar: http://tinyurl.com/PSToolbar PZ> I am trying to retrieve the file version information for a list of PZ> files (unsuccessfully). The objective is to find the version PZ> information on a list of file in a single user-defined path. In this PZ> sample, I'm attempting to retrieve the version of these files in the PZ> c:\windows\system32 directory, where installpath is the directory PZ> where the files are found. PZ> PZ> Should I be using foreach to repeat steps for each file in the list? PZ> PZ> #------------Begin script sample PZ> PZ> param( PZ> [string] $installpath = $(Throw "installpath required.") PZ> #required parameter PZ> ) PZ> $files = $installpath + "\dfrgsnap.dll",$installpath + PZ> "\dfrgui.dll",$installpath + "\dfsshlex.dll" PZ> PZ> dir $files | format-list VersionInfo PZ> PZ> #------------End script sample PZ> PZ> Regards, PZ> PZ> Pete Zerger, MCSE(Messaging) | MCTS(SQL 2005) | MCTS(Opsmgr) | MVP - PZ> Opsmgr PZ> URL:http://www.systemcenterforum.org PZ> User Group: http://www.systemcenterusergroup.com PZ> MP Catalog: http://www.systemcenterforum.org/mps |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Can the "now playing" list be retrieved if a file is accedentally opened, losing list | Media Center | |||
| Retrieving file count from a list of child folders | PowerShell | |||
| File Names Not Sorted Properly In File List | Vista file management | |||
| Re: HOW TO: Modify the way a file list looks. | PowerShell | |||
| Include shared folder/file in "save" file list | Vista General | |||