Does anyone know how pwsh and linux handles certificates when using HTTPS? I’m running into an issue when utilizing Invoke-RestMethod through our job scheduler. I do not get an error when I run it directly through the terminal.
Error:
Invoke-RestMethod : The remote certificate is invalid according to the validation procedure.
At line:1 char:1
-
Invoke-RestMethod -uri 'https://blogs.msdn.microsoft.com/powershell/f …
-
-
CategoryInfo : InvalidOperation: (Method: GET, Re…rShell/6.1.3
}:HttpRequestMessage) [Invoke-RestMethod], HttpRequestException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
EXIT STATUS VALUE OF $? THE COMMAND THROUGH POWERSHELL: 0