posts
$envTermGroup = "Document Management Tags" $termSId = "b6ddada5-25b5-xxx-xxxx-b473235d6278" #c65620d8-ee35-4a47-83ed-3da15bf74a0a" #Tags old term set $csvPath = "C:\Users\343614\OneDrive - ssss\Documents\scripts\termsets_import\Import csv - all tags - with synonyms - Delta - test.csv" $logFile = ".\term_synonyms_Log-$(Get-Date -Format "yyyyMMdd-HHmm").csv" function Log-Message { param ( [string]$Message, [string]$Status ) switch ($Status) { "Success" { $color = "Green" } "Info" { $color = "Blue" } "Error" { $color = "Red" } default { $color = "White" } } Write-Host -ForegroundColor $color "$Status => $Message" $logEntry = [PSCustomObject]@{ Timestamp = (Get-Date).
posts
The cmdlet Set-PnPListItem has different UpdateTypes: SystemUpdate, UpdateOverwriteVersion. Read more Set-PnPListItem
To update author or any other properties like retention use the UpdateType SystemUpdate To update editor use the UpdateType UpdateOverwriteVersion as system update does not work.
One Caveat of updating editor of a migrated file creates another version which is annoying, otherwise works well with files created and maintained within the site itself.
if($newAuthor) { try { if($item.FieldValues["Author"].email.ToLower() -eq $author.
posts
Auto Trimming version - Minor Major # ===== Settings ===== $clientId = "xxxxxxxx" $dateTime = Get-Date -Format "yyyy-MM-dd-HH-mm-ss" $CertPath = Read-Host "Please enter Certificate (.PFX) Path" $CertPassword = Read-Host "Please enter Certificate Password" -AsSecureString $Org = "contoso.onmicrosoft.com" $fileUrl = "https://contoso.sharepoint.com/sites/test/Documents/test_resh_retentionlabel.docx" $invocation = Get-Variable -Name MyInvocation -ValueOnly $directoryPath = Split-Path $invocation.MyCommand.Path function Get-LibraryNameFromFileUrl { param([string]$fileUrl, [string]$siteUrl) # Remove base site URL $relative = $fileUrl.Replace($siteUrl, "") # Trim leading "/" if ($relative.StartsWith("/")) { $relative = $relative.