



This checks if file exists in SharePoint document library with csom PowerShell. Write-host "File Doesn't Exists in the given URL!" -f Red Write-host "File Exists in the Given URL!" -f Green $FileExists = Check-FileExists -SiteURL $SiteURL -FileRelativeURL $FileRelativeURL -Credentials $Cred #Call the function to Check Column Exists in given list $Cred = New-Object ($Cred.UserName,$Cred.Password) $FileRelativeURL="/sites/Sales/TeamDocuments/LegalTemplate.docx" #Set Variables for Site URL, List Name and Column Name #Function to Check if file exists in given URLįunction Check-FileExists($SiteURL, $FileRelativeURL, $Credentials) Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\"Īdd-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\.dll"
