We currently use windows .BAT files with cURL to automate our SIS feeds. I'm working to convert them to Powershell. For example:
$file = "G:\Export_files\Blackboard Transfer\COURSES.txt"
$uri = "mcphs.blackboard.com/webapps/bb-data-integration-flatfile-BBLEARN/endpoint/course/refresh"
$username = "username"
$password = "password" | ConvertTo-SecureString -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($username,$password)
Invoke-WebRequest -Credential $cred -ContentType "text/plain" -Method POST -Uri $uri -InFile $file
But no matter what I try, I always receive a 401 error in response:
Invoke-WebRequest : HTTP Status 401 -
type Status report
description This request requires HTTP authentication.
I've read that this can be fixed by ignoring SSL validation for the request, but the many workarounds in Powershell don't seem to work. Can anybody help?