From f2093996c952beef015459109683b3fb65a52e14 Mon Sep 17 00:00:00 2001 From: Andy Beltz Date: Fri, 14 Jun 2024 08:02:16 -0600 Subject: [PATCH] refactor: update inv functions (#657) - Updated `New-AriaNetworksvCenterDataSource` cmdlet to add a vCenter Server in VMware Aria Operations for Networks. - Updated `New-AriaNetworksNsxtDataSource` cmdlet to add a NSX Manager in VMware Aria Operations for Networks - Enhanced `Request-AriaNetworksToken` cmdlet for better readability and consistency with other cmdlets. Signed-off-by: Andy Beltz " --- CHANGELOG.md | 1 + PowerValidatedSolutions.psd1 | 1 + PowerValidatedSolutions.psm1 | 20 ++++++++++--------- .../New-AriaNetworksNsxtDataSource.md | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a32a2e9..2eb376a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ - Enhanced `New-vRAvROPSIntegrationItem` cmdlet for better error checking and message handling. - Enhanced `Undo-vRAvROPsIntegrationItem` cmdlet for better error checking and message handling. - Enhanced `Update-vROPSvRAAdapterCredential` cmdlet to reduce the number of inputs required. +- Enhanced `Request-AriaNetworksToken` cmdlet for better readability and consistency with other cmdlets. ## v2.10.0 diff --git a/PowerValidatedSolutions.psd1 b/PowerValidatedSolutions.psd1 index 3a232a1d..d330524f 100644 --- a/PowerValidatedSolutions.psd1 +++ b/PowerValidatedSolutions.psd1 @@ -12,6 +12,7 @@ # Version number of this module. ModuleVersion = '2.11.0.1019' + # Supported PSEditions # CompatiblePSEditions = @() diff --git a/PowerValidatedSolutions.psm1 b/PowerValidatedSolutions.psm1 index 021f33d7..2427879d 100644 --- a/PowerValidatedSolutions.psm1 +++ b/PowerValidatedSolutions.psm1 @@ -51215,14 +51215,14 @@ Function Request-AriaNetworksToken { $ariaNetworksHeader.Add("Accept", "application/json") $ariaNetworksHeader.Add("Content-Type", "application/json") $uri = "https://$ariaNetworksAppliance/api/ni/auth/token" - $body = '{ - "username": "'+ $username +'", - "password": "'+ $password +'", - "domain": { - "domain_type": "LOCAL", - "value": "local" - } - }' + $body = @{ + username = $username + password = $password + domain = @{ + "domain_type" = "LOCAL" + "value" = "local" + } + } | ConvertTo-Json if ($PSEdition -eq 'Core') { $ariaNetworksResponse = Invoke-RestMethod -Uri $uri -Method 'POST' -Headers $ariaNetworksHeader -Body $body -SkipCertificateCheck # PS Core has -SkipCertificateCheck implemented, PowerShell 5.x does not } else { @@ -51445,6 +51445,7 @@ Function New-AriaNetworksvCenterDataSource { Write-Error $_.Exception.Message } } +Export-ModuleMember -Function New-AriaNetworksvCenterDataSource Function New-AriaNetworksNsxtDataSource { <# @@ -51463,7 +51464,7 @@ Function New-AriaNetworksNsxtDataSource { This example adds a NSX Manager as a new data source in VMware Aria Operations for Networks by using a NSX service account user with a password. .PARAMETER fqdn - The NSX Manager to add as a data source. + The fully qualified domain name of the NSX Manager to add as a data source. .PARAMETER certificate The principal identity certificate to use for authentication. @@ -51547,6 +51548,7 @@ Function New-AriaNetworksNsxtDataSource { Write-Error $_.Exception.Message } } +Export-ModuleMember -Function New-AriaNetworksNsxtDataSource #EndRegion End VMware Aria Operations for Networks Functions ###### ################################################################################### diff --git a/docs/documentation/functions/aria-suite/aria-operations-networks/New-AriaNetworksNsxtDataSource.md b/docs/documentation/functions/aria-suite/aria-operations-networks/New-AriaNetworksNsxtDataSource.md index 945bdfd4..b60a952b 100644 --- a/docs/documentation/functions/aria-suite/aria-operations-networks/New-AriaNetworksNsxtDataSource.md +++ b/docs/documentation/functions/aria-suite/aria-operations-networks/New-AriaNetworksNsxtDataSource.md @@ -46,7 +46,7 @@ This example adds a NSX Manager as a new data source in VMware Aria Operations f ### -fqdn -The NSX Manager to add as a data source. +The fully qualified domain name of the NSX Manager to add as a data source. ```yaml Type: String