dev #1
@@ -15,25 +15,35 @@ param(
|
|||||||
[string]$Description = 'MSFT-Custom-Solution:MegaMenu'
|
[string]$Description = 'MSFT-Custom-Solution:MegaMenu'
|
||||||
)
|
)
|
||||||
|
|
||||||
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null
|
if (-not (Get-Command -Name Get-SPSite -ErrorAction SilentlyContinue)) {
|
||||||
|
if (Get-Module -ListAvailable -Name Microsoft.SharePoint.PowerShell) {
|
||||||
|
Import-Module Microsoft.SharePoint.PowerShell -DisableNameChecking
|
||||||
|
}
|
||||||
|
elseif (Get-PSSnapin -Registered -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) {
|
||||||
|
Add-PSSnapin Microsoft.SharePoint.PowerShell
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw 'Die SharePoint PowerShell-Komponenten wurden nicht gefunden. Bitte in der SharePoint Management Shell ausfuehren.'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$componentId = [Guid]'c0abbffb-355d-4d4e-bd38-9e15fb811506'
|
$componentId = [Guid]'c0abbffb-355d-4d4e-bd38-9e15fb811506'
|
||||||
$legacyComponentId = [Guid]'abc3361f-bb2d-491f-aba3-cd51c19a299b'
|
$legacyComponentId = [Guid]'abc3361f-bb2d-491f-aba3-cd51c19a299b'
|
||||||
$location = 'ClientSideExtension.ApplicationCustomizer'
|
$location = 'ClientSideExtension.ApplicationCustomizer'
|
||||||
$configurationProperty = 'PortalSettings.MegaMenu.Configuration'
|
$configurationProperty = 'PortalSettings.MegaMenu.Configuration'
|
||||||
|
|
||||||
$properties = @{
|
$properties = [string](@{
|
||||||
termSetName = $TermSetName
|
termSetName = $TermSetName
|
||||||
termSetId = $TermSetId
|
termSetId = $TermSetId
|
||||||
cacheMinutes = $CacheMinutes
|
cacheMinutes = $CacheMinutes
|
||||||
debug = [bool]$EnableDebug.IsPresent
|
debug = [bool]$EnableDebug.IsPresent
|
||||||
} | ConvertTo-Json -Depth 10 -Compress
|
} | ConvertTo-Json -Depth 10 -Compress)
|
||||||
|
|
||||||
$site = Get-SPSite -Identity $SiteUrl
|
$site = Get-SPSite -Identity $SiteUrl
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$rootWeb = $site.RootWeb
|
$rootWeb = $site.RootWeb
|
||||||
$rootWeb.AllProperties[$configurationProperty] = $properties
|
$rootWeb.AllProperties[$configurationProperty] = [string]$properties
|
||||||
$rootWeb.Update()
|
$rootWeb.Update()
|
||||||
|
|
||||||
$siteActions = @(
|
$siteActions = @(
|
||||||
|
|||||||
@@ -5,7 +5,17 @@ param(
|
|||||||
[string]$Description = 'MSFT-Custom-Solution:MegaMenu'
|
[string]$Description = 'MSFT-Custom-Solution:MegaMenu'
|
||||||
)
|
)
|
||||||
|
|
||||||
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null
|
if (-not (Get-Command -Name Get-SPSite -ErrorAction SilentlyContinue)) {
|
||||||
|
if (Get-Module -ListAvailable -Name Microsoft.SharePoint.PowerShell) {
|
||||||
|
Import-Module Microsoft.SharePoint.PowerShell -DisableNameChecking
|
||||||
|
}
|
||||||
|
elseif (Get-PSSnapin -Registered -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) {
|
||||||
|
Add-PSSnapin Microsoft.SharePoint.PowerShell
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw 'Die SharePoint PowerShell-Komponenten wurden nicht gefunden. Bitte in der SharePoint Management Shell ausfuehren.'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$componentId = [Guid]'c0abbffb-355d-4d4e-bd38-9e15fb811506'
|
$componentId = [Guid]'c0abbffb-355d-4d4e-bd38-9e15fb811506'
|
||||||
$legacyComponentId = [Guid]'abc3361f-bb2d-491f-aba3-cd51c19a299b'
|
$legacyComponentId = [Guid]'abc3361f-bb2d-491f-aba3-cd51c19a299b'
|
||||||
|
|||||||
Reference in New Issue
Block a user