Skip to content

Commit

Permalink
Handling upgrade of post 1.2.7 #567
Browse files Browse the repository at this point in the history
  • Loading branch information
tarjeieo committed Jan 16, 2022
1 parent 361339d commit 2d89788
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Install/Install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,22 @@ catch {
Write-Host "[WARNING] Failed to run post-install steps: $($_.Exception.Message)" -ForegroundColor Yellow
}

if ($Upgrade.IsPresent) {
try {
$LastInstall = Get-PnPListItem -List "Installasjonslogg" -Query "<View><Query><OrderBy><FieldRef Name='Created' Ascending='False' /></OrderBy></Query></View>" | Select-Object -First 1
if ($null -ne $LastInstall) {
$PreviousVersion = $LastInstall.FieldValues["InstallVersion"]

if ($PreviousVersion -lt "1.2.7") {
Write-Host "[INFO] In version v1.2.7 we added 'Prosjekttidslinje' to the top navigation. Adding this navigation item now as part of the upgrade"
Add-PnPNavigationNode -Location TopNavigationBar -Title "Prosjekttidslinje" -Url "$($Uri.LocalPath)/SitePages/Prosjekttidslinje.aspx"
}
}
}
catch {
Write-Host "[WARNING] Failed to run upgrade steps: $($_.Exception.Message)" -ForegroundColor Yellow
}
}

$sw.Stop()

Expand Down

0 comments on commit 2d89788

Please sign in to comment.