forked from microsoft/MSIX-PackageSupportFramework
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSet-DllVersionByDate.ps1
27 lines (20 loc) · 947 Bytes
/
Set-DllVersionByDate.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#
# Set-DllVersionByDate FilePathDll
#
# Purpose: Used as a dll library post build action, it sets the version of the dll file using today's date.
# or just manually set in rc files before build
Param(
[Parameter(Mandatory=$true)]
[string]$PathToStampVer,
[Parameter(Mandatory=$true)]
[string]$FilePathDll
)
$fullDate = get-date
$curYear = $fullDate.Year
$curMonth = $fullDate.Month
$curDay = $fullDate.Day
$curMins = (($fullDate.Hour) * 60) + $fullDate.Minute
Write-output "Set version $($curYear).$($curMonth).$($curDay).$($CurMins) on file $($FilePathDll)"
#Write-output "cmd:Start-Process $($PathToStampVer) -ArgumentList" "-o4" "," "-f`"$($curYear).$($curMonth).$($curDay).$($curMins)`"" "," "$($FilePathDll)"
Start-Process $PathToStampVer -ArgumentList "-o4", "-f`"$($curYear).$($curMonth).$($curDay).$($curMins)`"", "-p`"$($curYear).$($curMonth).$($curDay).$($curMins)`"", "$($FilePathDll)"
Write-output "Done."