feat: update version to 2.1.2 and enhance ExpiryIndicator functionality with new binding handling

This commit is contained in:
Torsten Brendgen
2026-07-18 23:48:40 +02:00
parent 69a96b90c5
commit d97dbf45aa
10 changed files with 71 additions and 18 deletions

View File

@@ -18,6 +18,23 @@ $isapiPath = Join-Path ([Environment]::GetFolderPath('CommonProgramFiles')) 'mic
Add-Type -Path (Join-Path $isapiPath 'Microsoft.SharePoint.Client.Runtime.dll')
Add-Type -Path (Join-Path $isapiPath 'Microsoft.SharePoint.Client.dll')
function Expand-ExpiryIndicatorBindings {
param([object]$Value)
if ($null -eq $Value) { return }
if ($Value -is [System.Array]) {
foreach ($item in $Value) {
Expand-ExpiryIndicatorBindings -Value $item
}
return
}
if ($Value.PSObject.Properties['webUrl'] -and
$Value.PSObject.Properties['listId'] -and
$Value.PSObject.Properties['fieldInternalName']) {
Write-Output $Value
}
}
$context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl)
$context.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
@@ -50,7 +67,8 @@ try {
$existingBindingsJson = [string]$rootWeb.AllProperties[$bindingsKey]
if (-not [string]::IsNullOrWhiteSpace($existingBindingsJson)) {
try {
$bindings = @($existingBindingsJson | ConvertFrom-Json)
$parsedBindings = $existingBindingsJson | ConvertFrom-Json
$bindings = @(Expand-ExpiryIndicatorBindings -Value $parsedBindings)
}
catch {
$bindings = @()