An explicit .Refresh() is required after some operations to update the state of the FileInfo. Some operations internally call Invalidate() so any subsequent status check will trigger a lazy Refresh().
[System.String]$RequiredVersion = '1.2.3' [System.IO.FileInfo]$FileInfo = Get-Item -LiteralPath $FilePath If ($FileInfo.VersionInfo.FileVersion -eq $RequiredVersion ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results