I am trying to validate urls from a link list or other lists with hyper link columns in SharePoint Online.
I tried Invoke-WebRequest method after successfully connecting the SPO site. But this always returns 200 as status code, even for a broken spo link.
Code:
$SPOSiteConnect = Connect-PnPOnline –Url "https://mytenant.sharepoint.com/sites/test1" -ClientId $ClientId -CertificatePath $CertificatePath -CertificatePassword (ConvertTo-SecureString -AsPlainText $pwd -Force) -Tenant $Tenant
Invoke-WebRequest "https://mytenant.sharepoint.com/sites/test1/Forms/Folders.aspx" -UseBasicParsing
Any help appreciated.
Thanks Venky.