Skip to content

Commit e714d54

Browse files
Create Recursive-FileVersions.ps1
1 parent c2defe2 commit e714d54

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
cd 'C:\Program Files\Microsoft System Center\Operations Manager'
2+
$output = $null
3+
$output = @()
4+
5+
$files = Get-ChildItem .\* -Recurse
6+
foreach ($file in $files)
7+
{
8+
$fileversion = (Get-Item $file).VersionInfo.FileVersion
9+
$productversion = (Get-Item $file).VersionInfo.ProductVersion
10+
if ($fileversion -or $productversion)
11+
{
12+
$fileData = Get-Item $file
13+
$output += @{ FilePath = $fileData.FullName; FileVersion = $fileversion; ProductVersion = $productversion; DateModified = ($fileData.LastWriteTimeUtc.ToLocalTime()) }
14+
}
15+
}
16+
cls
17+
$output | % { new-object PSObject -Property $_ } | Sort-Object -Property FileVersion, FilePath | Select-Object FilePath, FileVersion, ProductVersion, DateModified

0 commit comments

Comments
 (0)