Skip to content

Commit 450859e

Browse files
committed
Refactor Get-NetAppOntapAPI to streamline certificate validation for Unix platforms
1 parent 3445088 commit 450859e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- Refactor Export-AbrOntapDiagram to handle image format for Unix platforms and improve error messaging
1717
- Bump Diagrammer.Core module requirement to v0.2.33
1818
- Bump module version to v0.6.10
19+
- Refactor Get-NetAppOntapAPI to streamline certificate validation for Unix platforms
1920

2021
### Fixed
2122

Src/Private/Get-NetAppOntapAPI.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ function Get-NetAppOntapAPI {
2626
)
2727

2828
begin {
29-
if ($PSVersionTable.Platform -ne 'Unix') {
30-
#region Workaround for SelfSigned Cert an force TLS 1.2
31-
if (-not ([System.Management.Automation.PSTypeName]'ServerCertificateValidationCallback').Type) {
32-
$certCallback = @"
29+
$certCallback = @"
3330
using System;
3431
using System.Net;
3532
using System.Net.Security;
@@ -55,6 +52,9 @@ function Get-NetAppOntapAPI {
5552
}
5653
}
5754
"@
55+
if ($PSVersionTable.PSEdition -ne 'Core') {
56+
#region Workaround for SelfSigned Cert an force TLS 1.2
57+
if (-not ([System.Management.Automation.PSTypeName]'ServerCertificateValidationCallback').Type) {
5858
Add-Type $certCallback
5959
}
6060
[ServerCertificateValidationCallback]::Ignore()

0 commit comments

Comments
 (0)