Posts

Showing posts from August, 2023

Update List/Library Metadata of SharePoint List(Online) using PNP PowerShell

cls $error.Clear() #get the location of the script file $scriptBase=Split-Path $SCRIPT:MyInvocation.MyCommand.Path -Parent  Set-Location $scriptBase  $path=Get-Location  $FilePath="$path\"+"Documents.csv"  #Output log file name $outputFile="updateMetadataLog.csv"  $outputfilepath="$path\"+$outputFile  #Portal url $SiteURL= "SITEURL"  #Connect to PnP Online Connect-PnPOnline -Url $SiteURL -ClientId CLIENTID #Get the Root Web $Web = Get-PnPWeb #Get the Site Title Write-host -f Green $Web.Title  # Library Name $libraryName="DOCUMENT LIBRARY" $DocId="" $srcFileName="" $metadatastatus=""  #function to export to log file function exporttoLog() {    $data = @{             "SourceFileName"=$srcFileName                    "Status"=$metadatastatus            }    New-Object PSObject -Property $data }  function...