From 6f19786b55fcbd49d6b6323259b9f6d4b13bc411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarjei=20E=2E=20Ormest=C3=B8yl?= Date: Wed, 15 May 2024 11:10:15 +0200 Subject: [PATCH 1/2] Error handling installation log --- Install/Install.ps1 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Install/Install.ps1 b/Install/Install.ps1 index 5fc12d261..6edaba737 100644 --- a/Install/Install.ps1 +++ b/Install/Install.ps1 @@ -211,7 +211,7 @@ if ($Alias.Length -lt 2 -or (@("sites/", "teams/") -notcontains $ManagedPath) -o } #endregion -$LogFilePath = "$PSScriptRoot/Install_Log_$([datetime]::Now.Ticks).txt" +$LogFilePath = "$PSScriptRoot/Install_Log_$([datetime]::Now.ToString("yy-MM-ddThh-mm-ss")).txt" Set-PnPTraceLog -On -Level Debug -LogFile $LogFilePath #region Create site @@ -591,11 +591,15 @@ if ($Channel -ne "main") { } ## Logging installation to SharePoint list -$InstallationEntry = Add-PnPListItem -List "Installasjonslogg" -Values $InstallEntry -ErrorAction SilentlyContinue +$InstallationEntry = Add-PnPListItem -List "Installasjonslogg" -Values $InstallEntry -ErrorAction Continue ## Attempting to attach the log file to installation entry if ($null -ne $InstallationEntry) { - $AttachmentOutput = Add-PnPListItemAttachment -List "Installasjonslogg" -Identity $InstallationEntry.Id -Path $LogFilePath -ErrorAction SilentlyContinue + $File = Get-Item -Path $LogFilePath + if ($null -ne $File -and $File.Length -gt 0) { + Write-Host "[INFO] Attaching installation log file to installation entry" + $AttachmentOutput = Add-PnPListItemAttachment -List "Installasjonslogg" -Identity $InstallationEntry.Id -Path $LogFilePath -ErrorAction Continue + } } Disconnect-PnPOnline From 3772db29ba12e13d113390a01ae9f9dbc1a0057b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarjei=20E=2E=20Ormest=C3=B8yl?= Date: Wed, 4 Sep 2024 14:02:58 +0200 Subject: [PATCH 2/2] Minor tweak to fields in prosjekter-list --- .../Portfolio/Objects/Lists/Prosjekter.xml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/Templates/Portfolio/Objects/Lists/Prosjekter.xml b/Templates/Portfolio/Objects/Lists/Prosjekter.xml index 7b99c3997..4d47d8a26 100644 --- a/Templates/Portfolio/Objects/Lists/Prosjekter.xml +++ b/Templates/Portfolio/Objects/Lists/Prosjekter.xml @@ -10,25 +10,14 @@ 100