Bump version to 2.0.1, update deployment strategy for central SPFx deployment, and enhance error handling in PowerShell script
This commit is contained in:
@@ -64,8 +64,15 @@ try {
|
||||
|
||||
foreach ($web in $site.AllWebs) {
|
||||
try {
|
||||
$webUrl = $web.Url
|
||||
$userCustomActions = $web.UserCustomActions
|
||||
|
||||
if ($null -eq $userCustomActions) {
|
||||
throw ('UserCustomActions konnten fuer das Web nicht geladen werden: ' + $webUrl)
|
||||
}
|
||||
|
||||
$actions = @(
|
||||
$web.UserCustomActions |
|
||||
$userCustomActions |
|
||||
Where-Object {
|
||||
$_.ClientSideComponentId -eq $componentId -or
|
||||
$_.ClientSideComponentId -eq $legacyComponentId
|
||||
@@ -88,7 +95,7 @@ try {
|
||||
}
|
||||
|
||||
if (-not $currentAction) {
|
||||
$currentAction = $web.UserCustomActions.Add()
|
||||
$currentAction = $userCustomActions.Add()
|
||||
$currentAction.Name = [Guid]::NewGuid().ToString('B')
|
||||
$created++
|
||||
}
|
||||
@@ -105,7 +112,7 @@ try {
|
||||
$currentAction.Update()
|
||||
$web.Update()
|
||||
|
||||
Write-Host ('MegaMenu synchronisiert: ' + $web.Url) -ForegroundColor Green
|
||||
Write-Host ('MegaMenu synchronisiert: ' + $webUrl) -ForegroundColor Green
|
||||
}
|
||||
finally {
|
||||
$web.Dispose()
|
||||
|
||||
Reference in New Issue
Block a user