Last active
October 12, 2015 01:15
-
-
Save martin9700/4e5ff4f7e20e03b52ad9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Manifest = Invoke-Expression -Command (Get-Content $OutManifest -Raw) | |
$LastChange = (Get-ChildItem $OutManifest).CreationTime | |
$ChangedFiles = ($Files | Where LastWriteTime -gt $LastChange).Count | |
$PercentChange = 100 - ((($Files.Count - $ChangedFiles) / $Files.Count) * 100) | |
$Version = ([version]$Manifest["ModuleVersion"]) | Select Major,Minor,Build,Revision | |
If ($PercentChange -ge 50) | |
{ | |
$Version.Major ++ | |
$Version.Minor = 0 | |
$Version.Build = 0 | |
$Version.Revision = 0 | |
} | |
ElseIf ($PercentChange -ge 25) | |
{ | |
$Version.Minor ++ | |
$Version.Build = 0 | |
$Version.Revision = 0 | |
} | |
ElseIf ($PercentChagne -ge 10) | |
{ | |
$Version.Build ++ | |
$Version.Revision = 0 | |
} | |
ElseIf ($PercentChange -gt 0) | |
{ | |
$Version.Revision ++ | |
} | |
$Manifest["ModuleVersion"] = "$($Version.Major).$($Version.Minor).$($Version.Build).$($Version.Revision)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment