我正在尝试从文件夹的指定位置获取所有最新版本的dll,但是我的脚本无任何输出。有人可以告诉我如何解决吗?
$path = "C:\Program Files\MySQL\Connector ODBC 8.0"
$files = Get-ChildItem $path -include *.dll
$files |
ForEach-Object {
try {
$_ | Add-Member NoteProperty FileVersion ($_.VersionInfo.FileVersion)
$_ | Add-Member NoteProperty AssemblyVersion (
[Reflection.AssemblyName]::GetAssemblyName($_.FullName).Version
)
} catch {}
$_
} |
Select-Object Name,FileVersion,AssemblyVersion`