3
3
[string ]$Url ,
4
4
[Parameter (Mandatory = $false , HelpMessage = " Skip search configuration" )]
5
5
[switch ]$SkipSearchConfiguration ,
6
+ [Parameter (Mandatory = $false , HelpMessage = " Client ID of the Entra Id application used for interactive logins. Defaults to the multi-tenant Prosjektportalen app" )]
7
+ [string ]$ClientId = " da6c31a6-b557-4ac3-9994-7315da06ea3a" ,
6
8
[Parameter (Mandatory = $false , HelpMessage = " Do you want to perform an upgrade?" )]
7
9
[switch ]$Upgrade
8
10
)
@@ -25,8 +27,6 @@ function EndAction() {
25
27
Write-Host " Completed in $ ( $ElapsedSeconds ) s" - ForegroundColor Green
26
28
}
27
29
28
- # # TODO: Create install script
29
-
30
30
# region Setting variables based on input from user
31
31
[System.Uri ]$Uri = $Url.TrimEnd (' /' )
32
32
$ManagedPath = $Uri.Segments [1 ]
@@ -38,10 +38,10 @@ $TemplatesBasePath = "$PSScriptRoot/Templates"
38
38
Set-PnPTraceLog - Off
39
39
40
40
# TODO: Replace version from package.json/git-tag
41
- Write-Host " Installing Prosjektportalen veimodul version 1.0.0 " - ForegroundColor Cyan
41
+ Write-Host " Installing Prosjektportalen veimodul version 1.1.2 " - ForegroundColor Cyan
42
42
43
43
# region Print installation user
44
- Connect-PnPOnline - Url $AdminSiteUrl - Interactive - ErrorAction Stop - WarningAction Ignore
44
+ Connect-PnPOnline - Url $AdminSiteUrl - Interactive - ClientId $ClientId - ErrorAction Stop - WarningAction Ignore
45
45
$CurrentUser = Get-PnPProperty - Property CurrentUser - ClientObject (Get-PnPContext ).Web
46
46
Write-Host " [INFO] Installing with user [$ ( $CurrentUser.Email ) ]"
47
47
# endregion
@@ -50,7 +50,7 @@ Write-Host "[INFO] Installing with user [$($CurrentUser.Email)]"
50
50
if (-not $SkipSearchConfiguration.IsPresent ) {
51
51
StartAction(" Uploading search configuration" )
52
52
Try {
53
- Connect-PnPOnline - Url $AdminSiteUrl - Interactive - ErrorAction Stop - WarningAction Ignore
53
+ Connect-PnPOnline - Url $AdminSiteUrl - Interactive - ClientId $ClientId - ErrorAction Stop - WarningAction Ignore
54
54
Set-PnPSearchConfiguration - Scope Subscription - Path " $PSScriptRoot /SearchConfiguration.xml" - ErrorAction SilentlyContinue
55
55
EndAction
56
56
}
@@ -64,7 +64,7 @@ if (-not $SkipSearchConfiguration.IsPresent) {
64
64
65
65
# region Apply Template
66
66
StartAction(" Applying veimodul template" )
67
- Connect-PnPOnline - Url $Url - Interactive - ErrorAction Stop
67
+ Connect-PnPOnline - Url $Url - Interactive - ClientId $ClientId - ErrorAction Stop
68
68
Invoke-PnPSiteTemplate - Path " $ ( $TemplatesBasePath ) /veimodul.pnp" - ErrorAction Stop - WarningAction Ignore
69
69
EndAction
70
70
# endregion
@@ -73,7 +73,7 @@ EndAction
73
73
StartAction(" Configuring tillegg and standardinnhold" )
74
74
try {
75
75
76
- Connect-PnPOnline - Url $Url - Interactive - ErrorAction Stop
76
+ Connect-PnPOnline - Url $Url - Interactive - ClientId $ClientId - ErrorAction Stop
77
77
78
78
$ListContent = Get-PnPListItem - List Listeinnhold
79
79
$Prosjekttillegg = Get-PnPListItem - List Prosjekttillegg
@@ -109,14 +109,14 @@ EndAction
109
109
110
110
# region Logging installation
111
111
Write-Host " [INFO] Logging installation entry"
112
- Connect-PnPOnline - Url $Url - Interactive - ErrorAction Stop
112
+ Connect-PnPOnline - Url $Url - Interactive - ClientId $ClientId - ErrorAction Stop
113
113
$LastInstall = Get-PnPListItem - List " Installasjonslogg" - Query " <View><Query><OrderBy><FieldRef Name='Created' Ascending='False' /></OrderBy></Query></View>" | Select-Object - First 1 - Wait
114
114
$PreviousVersion = " N/A"
115
115
if ($null -ne $LastInstall ) {
116
116
$PreviousVersion = $LastInstall.FieldValues [" InstallVersion" ]
117
117
}
118
118
# TODO: Replace version from package.json/git-tag
119
- $CustomizationInfo = " Prosjektportalen veimodul 1.0.0 "
119
+ $CustomizationInfo = " Prosjektportalen veimodul 1.1.2 "
120
120
$InstallStartTime = (Get-Date - Format o)
121
121
$InstallEndTime = (Get-Date - Format o)
122
122
0 commit comments