New-SFClient Error: (400) Bad Request when using -Credential -Account
Starting on 2/14/2020, the New-SFClient cmdlet has been failing with 400 Bad request error when using parameters -Credential. I tried to pass PSCredential object through either New-Object System.Management.Automation.PSCredential($UserName,$Password) or Get-Credential.
The command that is being run is.
New-SfClient -Name ((Join-Path $env:USERPROFILE "Documents") + "\ShareFile.sfps") -Account CompanyName -Credential $Credential
The command works if I remove the -Credential parameter and uses the Popup web authentication to ShareFile.
Do you pass your $Password as securestring? If not, please try:
$Credential = New-Object System.Management.Automation.PSCredential($UserName, ($Password | ConvertTo-SecureString -AsPlainText -Force))