I was trying to download a file from an URL which required users login with SingleSignOn (SSO). The URL is a website using SAML authentication method. Is there anyway I can do in the script to authenticate the users or anything else I could do? The following method does not help as it prompt user for username and password but still did not get to the SSO, hence, it is still returning error "unathourized 401":
$credential = Get-Credential
$Url = 'xxxx'
$Dest = 'xxxx'
Invoke-WebRequest -Uri $Url -OutFile $Dest -Credential $credential
error:
"The remote server returned an error: (401) Unauthorized."