I have a powershell query which extracts files of sharepoint and downloads them to a specified folder, for another system to combine with another file and emails or prints together.
However recently we upgraded our Sharepoint and now at the end of each URL there is often ?csf=xyz.
This recent addition is now causing the our scripts to not download the file.
I am not sure on how in my below code (this person has left the company) and im just trying to learn, but could not see anywhere on the correct method to do it.
There is 1 part of the script where data cleansing happens and would be good to know to do it.
$DownloadPathandName = $DownloadPath + $outputFile
$DownloadPathandName = $DownloadPathandName -replace “%20”," "
$DownloadPathandName = $DownloadPathandName -replace “
$DownloadPathandName = $DownloadPathandName -replace “&”,"&"
Im just trying to get a strip everything after and include from “?csf=xxxxx”.
Hoping someone can help me out.