我想通過Powershell腳本將信息發佈到ServiceNow中的表中。當我運行它時,我得到一個錯誤通過Powershell將數據發佈到ServiceNow使用Invoke-WebRequest
Invoke-WebRequest : The remote server returned an error: (500) Internal Server Error.
有人可以幫我弄清楚如何解決這個問題嗎?謝謝大家。
$userName = 'helpMe'
$password = 'iAmStuck' | ConvertTo-SecureString -asPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($userName, $password)
$uri = 'stuff'
$postParams = "test"
#[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
Invoke-WebRequest -Uri $uri -Method Post -Body $postParams -Credential $cred