Skip to content

Instantly share code, notes, and snippets.

@Geertvdc
Last active February 26, 2016 15:17
Show Gist options
  • Save Geertvdc/d6a9825bf97d96ea57c1 to your computer and use it in GitHub Desktop.
Save Geertvdc/d6a9825bf97d96ea57c1 to your computer and use it in GitHub Desktop.
Param(
[String]$projectFolder,
[String]$buildId
)
if (-Not $projectfolder) {
Write-Host "no project folder set"
exit 1
}
if (-Not $buildId) {
Write-Host "no build Id set"
exit 1
}
$manifestfile = Get-Item -Path "$projectFolder\Package.appxmanifest"
$manifestXml = New-Object -TypeName System.Xml.XmlDocument
$manifestXml.Load($manifestfile.Fullname)
$currentVersion = [Version]$manifestXml.Package.Identity.Version
$updatedVersion = [Version]($currentVersion.Major.ToString() + '.' + $currentVersion.Minor + '.' + $currentVersion.Build + '.' + $buildId)
$manifestXml.Package.Identity.Version = [String]$updatedVersion
$manifestXml.save($manifestfile.FullName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment