I have a requirement to download files from a sharepoint online document library using powershell
I\'ve managed to get to the point where the download should happen
The direct and almost shortest answer to the question is simply:
$url = 'https://the.server/path/to/the/file.txt' $outfile = "$env:userprofile\file.txt" Invoke-WebRequest -Uri $url -OutFile $outfile -Credential (Get-Credential)
This works at least in Powershell 5.1...