-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathSetupWebConfiguration.ps1
30 lines (26 loc) · 1.25 KB
/
SetupWebConfiguration.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Changes to Web Client configuration
if ($isBcSandbox -or $multitenant) {
$wwwRootPath = Get-WWWRootPath
if ($isBcSandbox) {
write-Host "Enabling Financials User Experience"
$navsettingsFile = Join-Path $wwwRootPath "$webServerInstance\navsettings.json"
$config = Get-Content $navSettingsFile | ConvertFrom-Json
Add-Member -InputObject $config.NAVWebSettings -NotePropertyName "DefaultApplicationId" -NotePropertyValue "true" -ErrorAction SilentlyContinue
$config.NAVWebSettings.DefaultApplicationId = "FIN"
Add-Member -InputObject $config.NAVWebSettings -NotePropertyName "Designer" -NotePropertyValue "true" -ErrorAction SilentlyContinue
$config.NAVWebSettings.Designer = $true
$config | ConvertTo-Json | set-content $navSettingsFile
}
if ($multitenant) {
$webConfigFile = Join-Path $wwwRootPath "$webServerInstance\web.config"
try {
$webConfig = [xml](Get-Content $webConfigFile)
$webConfig.configuration.'system.webServer'.rewrite.rules.GetEnumerator() | % {
Write-Host "Enabling rewrite rule: $($_.Name)"
$_.Enabled = "true"
}
$webConfig.Save($webConfigFile)
}
catch {}
}
}