Skip to content

Commit 2375436

Browse files
authored
Merge pull request #59 from rebelinux/dev
v0.6.9
2 parents 4768577 + 5421b76 commit 2375436

File tree

4 files changed

+33
-24
lines changed

4 files changed

+33
-24
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- General code cleanup/improvements
1313
- Add Bluesky post action to release workflow
1414
- Increased Required Modules version:
15-
- Diagrammer.Core v0.2.30
15+
- Diagrammer.Core v0.2.32
1616
- NetApp.Ontap v9.17.1.2509
17+
- Refactor Get-NetAppOntapAPI to handle Unix platform and improve error handling in Invoke-AsBuiltReport.NetApp.ONTAP
1718

1819
### Fixed
1920

2021
- Fix issue where cluster replication diagram generation fails if no replication relationships are found.
22+
- Fix issue where certain sections of the report may not render correctly on Unix-based systems.
23+
- Close [#58](https://github.com/AsBuiltReport/AsBuiltReport.NetApp.ONTAP/issues/58)
2124

2225
## [0.6.8] - 2025-08-18
2326

Src/Private/Export-AbrOntapDiagram.ps1

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function Export-AbrOntapDiagram {
4848
'LogoName' = 'AsBuiltReport_LOGO'
4949
'SignatureLogoName' = 'Abr_LOGO_Footer'
5050
'WaterMarkText' = $Options.DiagramWaterMark
51-
'Direction' = &{
51+
'Direction' = & {
5252
if ($MainDiagramLabel -eq 'Cluster Replication Diagram') {
5353
'left-to-right'
5454
} else {
@@ -114,17 +114,22 @@ function Export-AbrOntapDiagram {
114114
}
115115
}
116116
try {
117-
$DiagramParams.Remove('Format')
118-
$DiagramParams.Add('Format', "base64")
117+
if ($PSVersionTable.Platform -ne 'Unix') {
118+
$DiagramParams.Remove('Format')
119+
$DiagramParams.Add('Format', "base64")
119120

120-
$Graph = $DiagramObject
121-
$Diagram = New-Diagrammer @DiagramParams -InputObject $Graph
122-
if ($Diagram) {
123-
if ((Get-DiaImagePercent -GraphObj $Diagram).Width -gt 600) { $ImagePrty = 40 } else { $ImagePrty = 30 }
124-
Section -Style Heading2 $MainDiagramLabel {
125-
Image -Base64 $Diagram -Text "NetApp Ontap Diagram" -Percent $ImagePrty -Align Center
126-
Paragraph "Image preview: Opens the image in a new tab to view it at full resolution." -Tabs 2
121+
$Graph = $DiagramObject
122+
$Diagram = New-Diagrammer @DiagramParams -InputObject $Graph
123+
if ($Diagram) {
124+
if ((Get-DiaImagePercent -GraphObj $Diagram).Width -gt 600) { $ImagePrty = 40 } else { $ImagePrty = 30 }
125+
Section -Style Heading2 $MainDiagramLabel {
126+
Image -Base64 $Diagram -Text "NetApp Ontap Diagram" -Percent $ImagePrty -Align Center
127+
Paragraph "Image preview: Opens the image in a new tab to view it at full resolution." -Tabs 2
128+
}
127129
}
130+
} else {
131+
Write-PScriboMessage -IsWarning -Message "PSCribo Images embedding is not supported on PowerShell Core running on Linux or MacOS."
132+
128133
}
129134
} catch {
130135
Write-PScriboMessage -IsWarning -Message "Unable to generate the Ontap Diagram: $($_.Exception.Message)"

Src/Private/Get-NetAppOntapAPI.ps1

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

2828
begin {
29-
#region Workaround for SelfSigned Cert an force TLS 1.2
30-
if (-not ([System.Management.Automation.PSTypeName]'ServerCertificateValidationCallback').Type) {
31-
$certCallback = @"
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 = @"
3233
using System;
3334
using System.Net;
3435
using System.Net.Security;
@@ -54,11 +55,12 @@ function Get-NetAppOntapAPI {
5455
}
5556
}
5657
"@
57-
Add-Type $certCallback
58+
Add-Type $certCallback
59+
}
60+
[ServerCertificateValidationCallback]::Ignore()
61+
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
62+
#endregion Workaround for SelfSigned Cert an force TLS 1.2
5863
}
59-
[ServerCertificateValidationCallback]::Ignore()
60-
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
61-
#endregion Workaround for SelfSigned Cert an force TLS 1.2
6264

6365
$username = $Credential.UserName
6466
$password = $Credential.GetNetworkCredential().Password
@@ -73,19 +75,19 @@ function Get-NetAppOntapAPI {
7375
}
7476
}
7577

76-
Process {
77-
Try {
78+
process {
79+
try {
7880
if ($PSVersionTable.PSEdition -eq 'Core') {
7981
$response = Invoke-RestMethod -Method Get -Uri ($api + $uri) -Headers $headers -SkipCertificateCheck
8082

8183
} else {
8284
$response = Invoke-RestMethod -Method Get -Uri ($api + $uri) -Headers $headers
8385
}
8486
$response.records
85-
} Catch {
87+
} catch {
8688
Write-Verbose -Message $_
8789
}
8890
}
8991

90-
End {}
92+
end {}
9193
}

Src/Public/Invoke-AsBuiltReport.NetApp.ONTAP.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@ function Invoke-AsBuiltReport.NetApp.ONTAP {
2121
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "", Scope = "Function")]
2222
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingWriteHost", "", Scope = "Function")]
2323

24+
#Requires -RunAsAdministrator
2425

2526
# Do not remove or add to these parameters
2627
param (
2728
[String[]] $Target,
2829
[PSCredential] $Credential
2930
)
3031

31-
#Requires -Version 5.1
32-
#Requires -PSEdition Desktop
3332
#Requires -RunAsAdministrator
3433

3534
if ($psISE) {

0 commit comments

Comments
 (0)