feat: update version to 2.1.2 and enhance ExpiryIndicator functionality with new binding handling
This commit is contained in:
@@ -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 = @()
|
||||
|
||||
Reference in New Issue
Block a user