From 465599d5b7d1fca1661536652b8f74c5419294f5 Mon Sep 17 00:00:00 2001 From: Mathijs de Ruiter <33999622+EUCTechTopics@users.noreply.github.com> Date: Thu, 27 Feb 2025 16:21:52 +0100 Subject: [PATCH 1/5] Updated welcome banner --- PSIdentityNow/Public/Connect-IDNW.ps1 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/PSIdentityNow/Public/Connect-IDNW.ps1 b/PSIdentityNow/Public/Connect-IDNW.ps1 index aef9c9a..d217fa7 100644 --- a/PSIdentityNow/Public/Connect-IDNW.ps1 +++ b/PSIdentityNow/Public/Connect-IDNW.ps1 @@ -25,7 +25,7 @@ #> function Connect-IDNW { - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments","")] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")] [CmdletBinding( SupportsShouldProcess = $False, ConfirmImpact = "None", @@ -35,7 +35,7 @@ function Connect-IDNW { param ( [Parameter(Mandatory = $false)] [Alias("Environment")] - [ValidateSet("Sandbox","ACC", "PRD")] + [ValidateSet("Sandbox", "ACC", "PRD")] [String] $Instance, @@ -59,7 +59,7 @@ function Connect-IDNW { } $Parameters = @{ - APIVersion = $APIVersion + APIVersion = $APIVersion UseSecretManagement = $UseSecretManagement } if ($PSBoundParameters.ContainsKey('Instance')) { @@ -71,6 +71,16 @@ function Connect-IDNW { } $script:IDNWEnv = Get-IDNWEnvironment @Parameters + + # Concatenate full version string with prerelease label if present + $PrereleaseLabel = $MyInvocation.MyCommand.Module.PrivateData.PSData['Prerelease'] + $ModuleVersion = $MyInvocation.MyCommand.Module.Version + if (-not [string]::isNullOrEmpty($PrereleaseLabel)) { + $VersionString = ("{0}-{1}" -f $ModuleVersion, $PrereleaseLabel) + } + else { + $VersionString = $ModuleVersion + } # Build formatted output using a here-string for alignment $identityNowInfo = @" @@ -85,7 +95,7 @@ Org: $($script:IDNWEnv.SessionTokenDetails.org) Authorities: $($script:IDNWEnv.SessionTokenDetails.Authorities -join ', ') Base URL: $($script:IDNWEnv.BaseAPIURL) API Version: $($script:IDNWEnv.APIVersion) -Module Version: $($MyInvocation.MyCommand.Module.Version) +Module Version: $($VersionString) Token Expires: $($script:IDNWEnv.SessionTokenDetails.expiryDateTime) "@ From 72fc7c55af8b9a901897bb103d1f14ce48014979 Mon Sep 17 00:00:00 2001 From: Mathijs de Ruiter <33999622+EUCTechTopics@users.noreply.github.com> Date: Thu, 27 Feb 2025 16:39:19 +0100 Subject: [PATCH 2/5] debug 1 --- PSIdentityNow/Public/Connect-IDNW.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/PSIdentityNow/Public/Connect-IDNW.ps1 b/PSIdentityNow/Public/Connect-IDNW.ps1 index d217fa7..4064151 100644 --- a/PSIdentityNow/Public/Connect-IDNW.ps1 +++ b/PSIdentityNow/Public/Connect-IDNW.ps1 @@ -95,7 +95,6 @@ Org: $($script:IDNWEnv.SessionTokenDetails.org) Authorities: $($script:IDNWEnv.SessionTokenDetails.Authorities -join ', ') Base URL: $($script:IDNWEnv.BaseAPIURL) API Version: $($script:IDNWEnv.APIVersion) -Module Version: $($VersionString) Token Expires: $($script:IDNWEnv.SessionTokenDetails.expiryDateTime) "@ From 194335bbccc177af4340680953794a749d5ee2e1 Mon Sep 17 00:00:00 2001 From: Mathijs de Ruiter <33999622+EUCTechTopics@users.noreply.github.com> Date: Thu, 27 Feb 2025 16:40:02 +0100 Subject: [PATCH 3/5] debug 2 --- PSIdentityNow/Public/Connect-IDNW.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PSIdentityNow/Public/Connect-IDNW.ps1 b/PSIdentityNow/Public/Connect-IDNW.ps1 index 4064151..0da2d21 100644 --- a/PSIdentityNow/Public/Connect-IDNW.ps1 +++ b/PSIdentityNow/Public/Connect-IDNW.ps1 @@ -73,7 +73,7 @@ function Connect-IDNW { $script:IDNWEnv = Get-IDNWEnvironment @Parameters # Concatenate full version string with prerelease label if present - $PrereleaseLabel = $MyInvocation.MyCommand.Module.PrivateData.PSData['Prerelease'] + # $PrereleaseLabel = $MyInvocation.MyCommand.Module.PrivateData.PSData['Prerelease'] $ModuleVersion = $MyInvocation.MyCommand.Module.Version if (-not [string]::isNullOrEmpty($PrereleaseLabel)) { $VersionString = ("{0}-{1}" -f $ModuleVersion, $PrereleaseLabel) From c18c96a1442baa07800598464ec12414813361a2 Mon Sep 17 00:00:00 2001 From: Mathijs de Ruiter <33999622+EUCTechTopics@users.noreply.github.com> Date: Thu, 27 Feb 2025 16:42:23 +0100 Subject: [PATCH 4/5] debug 3 --- PSIdentityNow/Public/Connect-IDNW.ps1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/PSIdentityNow/Public/Connect-IDNW.ps1 b/PSIdentityNow/Public/Connect-IDNW.ps1 index 0da2d21..e3f62f2 100644 --- a/PSIdentityNow/Public/Connect-IDNW.ps1 +++ b/PSIdentityNow/Public/Connect-IDNW.ps1 @@ -73,7 +73,14 @@ function Connect-IDNW { $script:IDNWEnv = Get-IDNWEnvironment @Parameters # Concatenate full version string with prerelease label if present - # $PrereleaseLabel = $MyInvocation.MyCommand.Module.PrivateData.PSData['Prerelease'] + if ($MyInvocation.MyCommand.Module -and + $MyInvocation.MyCommand.Module.PrivateData -and + $MyInvocation.MyCommand.Module.PrivateData.PSData) { + $PrereleaseLabel = $MyInvocation.MyCommand.Module.PrivateData.PSData['Prerelease'] + } + else { + $PrereleaseLabel = $null + } $ModuleVersion = $MyInvocation.MyCommand.Module.Version if (-not [string]::isNullOrEmpty($PrereleaseLabel)) { $VersionString = ("{0}-{1}" -f $ModuleVersion, $PrereleaseLabel) @@ -95,6 +102,7 @@ Org: $($script:IDNWEnv.SessionTokenDetails.org) Authorities: $($script:IDNWEnv.SessionTokenDetails.Authorities -join ', ') Base URL: $($script:IDNWEnv.BaseAPIURL) API Version: $($script:IDNWEnv.APIVersion) +Module Version: $($VersionString) Token Expires: $($script:IDNWEnv.SessionTokenDetails.expiryDateTime) "@ From f16e46a932d4da0b7b51662fa7e271d0d5588395 Mon Sep 17 00:00:00 2001 From: Mathijs de Ruiter <33999622+EUCTechTopics@users.noreply.github.com> Date: Thu, 27 Feb 2025 16:43:17 +0100 Subject: [PATCH 5/5] removed trailing whitespace --- PSIdentityNow/Public/Connect-IDNW.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PSIdentityNow/Public/Connect-IDNW.ps1 b/PSIdentityNow/Public/Connect-IDNW.ps1 index e3f62f2..24b32c1 100644 --- a/PSIdentityNow/Public/Connect-IDNW.ps1 +++ b/PSIdentityNow/Public/Connect-IDNW.ps1 @@ -73,8 +73,8 @@ function Connect-IDNW { $script:IDNWEnv = Get-IDNWEnvironment @Parameters # Concatenate full version string with prerelease label if present - if ($MyInvocation.MyCommand.Module -and - $MyInvocation.MyCommand.Module.PrivateData -and + if ($MyInvocation.MyCommand.Module -and + $MyInvocation.MyCommand.Module.PrivateData -and $MyInvocation.MyCommand.Module.PrivateData.PSData) { $PrereleaseLabel = $MyInvocation.MyCommand.Module.PrivateData.PSData['Prerelease'] }