In Powershell, any .NET Framework functions are available, so the file version can be obtained via the FileVersionInfo.GetVersionInfo method.
# файл для копирования и переименования $input = 'X:\Folder1\Folder2\...\Project.exe' # каталог назначения $output = '\\Server\Folder3\Folder4\...\' $path = [System.IO.Path] $version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($input).ProductVersion.ToString() $newFile = $path::GetFileNameWithoutExtension($input) + "_$version" + $path::GetExtension($input) $output = $path::Combine($output, $newFile) Copy-Item "$input" -Destination "$output"
ProductVersion can try FileVersion .
Project.exea .net application? - kmv