0

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:

  1. First command click on "Pick an account" box
  2. 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
}
Nick Pietrushka
  • 125
  • 2
  • 11

1 Answers1

0

use the parameter -Credentials like:

$cred = Get-Credential
Connect-PnPOnline -Url $SiteURL -Credentials $cred
Guenther Schmitz
  • 1,955
  • 1
  • 9
  • 23