Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions PSIdentityNow/Public/Connect-IDNW.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#>

function Connect-IDNW {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments","")]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")]
[CmdletBinding(
SupportsShouldProcess = $False,
ConfirmImpact = "None",
Expand All @@ -35,7 +35,7 @@ function Connect-IDNW {
param (
[Parameter(Mandatory = $false)]
[Alias("Environment")]
[ValidateSet("Sandbox","ACC", "PRD")]
[ValidateSet("Sandbox", "ACC", "PRD")]
[String]
$Instance,

Expand All @@ -59,7 +59,7 @@ function Connect-IDNW {
}

$Parameters = @{
APIVersion = $APIVersion
APIVersion = $APIVersion
UseSecretManagement = $UseSecretManagement
}
if ($PSBoundParameters.ContainsKey('Instance')) {
Expand All @@ -71,6 +71,23 @@ 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
$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)
}
else {
$VersionString = $ModuleVersion
}
# Build formatted output using a here-string for alignment
$identityNowInfo = @"

Expand All @@ -85,7 +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: $($MyInvocation.MyCommand.Module.Version)
Module Version: $($VersionString)
Token Expires: $($script:IDNWEnv.SessionTokenDetails.expiryDateTime)

"@
Expand Down