refactor: apply pr feedbacks
This commit is contained in:
Родитель
7731ac0374
Коммит
89f7648c0c
|
@ -1,21 +1,3 @@
|
|||
$sslCallbackCode = @"
|
||||
using System.Net.Security;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
public static class SslVerification
|
||||
{
|
||||
public static bool DisabledServerCertificateValidationCallback(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; }
|
||||
public static void Disable() { System.Net.ServicePointManager.ServerCertificateValidationCallback = DisabledServerCertificateValidationCallback; }
|
||||
public static void Enable() { System.Net.ServicePointManager.ServerCertificateValidationCallback = null; }
|
||||
}
|
||||
"@
|
||||
try {
|
||||
if (-not ([System.Management.Automation.PSTypeName]"SslVerification").Type) {
|
||||
Add-Type -TypeDefinition $sslCallbackCode -Language CSharp -WarningAction SilentlyContinue | Out-Null
|
||||
}
|
||||
}
|
||||
catch {}
|
||||
|
||||
<#
|
||||
.Synopsis
|
||||
Publish App to a NAV/BC Container
|
||||
|
|
|
@ -456,13 +456,13 @@ function GetExtendedErrorMessage {
|
|||
$exception = $errorRecord.Exception
|
||||
$message = $exception.Message
|
||||
|
||||
if ($errorRecord.ErrorDetails) {
|
||||
try {
|
||||
try {
|
||||
if ($errorRecord.ErrorDetails) {
|
||||
$errorDetails = $errorRecord.ErrorDetails | ConvertFrom-Json
|
||||
$message += " $($errorDetails.error)`r`n$($errorDetails.error_description)"
|
||||
}
|
||||
catch {}
|
||||
}
|
||||
catch {}
|
||||
try {
|
||||
if ($exception -is [System.Management.Automation.MethodInvocationException]) {
|
||||
$exception = $exception.InnerException
|
||||
|
|
Загрузка…
Ссылка в новой задаче