hytos / ID2.Manager / FileUpdate.ps1 @ a55ba94c
이력 | 보기 | 이력해설 | 다운로드 (855 Bytes)
1 |
$sourceFilePath = "D:\Source\Repos\DTIPID\ID2.Manager\Markus\KCOM.exe" |
---|---|
2 |
$targetFilePath = "D:\Source\Repos\DTIPID\ID2.Manager\ID2.Manager\bin\x64\Debug\KCOM.exe" |
3 |
|
4 |
#$sourceFilePath = $args[0] |
5 |
#$targetFilePath = $args[1] |
6 |
|
7 |
$sourceFileVersionInfo = Get-ItemProperty -Path $sourceFilePath -Name VersionInfo |
8 |
$targetFileVersionInfo = Get-ItemProperty -Path $targetFilePath -Name VersionInfo |
9 |
|
10 |
$sourceFileVersion = $sourceFileVersionInfo.VersionInfo.ProductVersion |
11 |
$targetFileVersion = $targetFileVersionInfo.VersionInfo.ProductVersion |
12 |
|
13 |
Write-Output "Source File Version: $sourceFileVersion" |
14 |
Write-Output "target File Version: $targetFileVersion" |
15 |
|
16 |
if ([version]$sourceFileVersion -gt [version]$targetFileVersion) { |
17 |
Copy-Item -Path $sourceFilePath -Destination $targetFilePath -Force |
18 |
Write-Host "File copied." |
19 |
} else { |
20 |
Write-Host "No need to copy." |
21 |
} |