i have a working script for logging to sharepoint and load the needed file, but for some account it doesn't work (not azure synchronize etc.) and even with -UseWebLogin still asked me to select the account and input password and login. So what i need:
- First command click on "Pick an account" box
- Input pass and login
and that's it
I tried that option but still no success, could please help to handle it i have no idea how to pass parameters with -UseWebLogin
Thank you in advance
$SiteURL = "https://sharepoint.com/sites/..."
$FileRelativeURL = "/../....docx"
$DownloadPath = "C:\Temp"
Try {
#Connect to PNP Online
Connect-PnPOnline -Url $SiteURL -UseWebLogin
# download file
Get-PnPFile -Url $FileRelativeURL -Path $DownloadPath -AsFile
}
catch {
write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
}