![]() In order to download a file from OneDrive, you will not be able to simply provide your username / password in a object like you get from Get-Credential. Why Get-Credential Won't work on it's own $DEST = "5.2.0\Content Manager Setup.exe" Unregister-Event -SourceIdentifier WebClient.DownloadFileComplete Unregister-Event -SourceIdentifier WebClient.DownloadProgressChanged Write-Progress -Activity 'Downloading file' -Status $url -Complete Write-Progress -Activity 'Downloading file' -Status $url -PercentComplete $pc $pc = $Global:DPCEventArgs.ProgressPercentage ![]() $client.DownloadFileAsync($url, $localFile) Write-Progress -Activity 'Downloading file' -Status $url The code I have is here: $CheckFile = Test-Path "$PSScriptRoot\5.2.0\Content Manager Setup.exe" Here is the code I am using right now, it has been tested working to download a file, however if there is authentication required such as one drive, I am not able to authenticate and download the file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |