Skip to content

Commit

Permalink
0.1 Update 3 (#6)
Browse files Browse the repository at this point in the history
* 🚸🧑‍💻FIX Path Resolution

Replaces `[Environment]::GetEnvironmentVariable('Temp')` with `[System.IO.Path]::GetTempPath()` to correctly determine %TEMP% directory location on Windows as well as OSX.
Users reported issue #5 where command invocation fails on Mac OS due to Path error.

* ♻️🧑‍💻 UPDATE ScriptMethods

Moves ScriptMethod declaration into code body from `\xml\IdCmd.ID.Session.Types.ps1xml`.

* Update CHANGELOG.md
  • Loading branch information
pspete authored Oct 8, 2023
1 parent f8a6566 commit 0f0d0d7
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 46 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Change Log
All notable changes to this project will be documented in this file.

## [unreleased] - 2023-09-19
## [unreleased] - 2023-10-08

### Added
- N/A
Expand All @@ -12,6 +12,17 @@ All notable changes to this project will be documented in this file.
### Fixed
- N/A

## [0.1 - Update 3] - 2023-10-08

### Added
- N/A

### Changed
- `New-IDSession` - Moves ScriptMethod declaration into code body from `\xml\IdCmd.ID.Session.Types.ps1xml`.

### Fixed
- Replaces `[Environment]::GetEnvironmentVariable('Temp')` with `[System.IO.Path]::GetTempPath()` to correctly determine %TEMP% directory location on Windows as well as OSX.

## [0.1 - Update 2] - 2023-09-19

### Added
Expand Down
6 changes: 2 additions & 4 deletions IdentityCommand/IdentityCommand.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'IdentityCommand.psm1'

# Version number of this module.
ModuleVersion = '0.1.39'
ModuleVersion = '0.1.40'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -60,9 +60,7 @@
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
TypesToProcess = @(
'xml\IdCmd.ID.Session.Types.ps1xml'
)
# TypesToProcess = @( )

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = @(
Expand Down
2 changes: 1 addition & 1 deletion IdentityCommand/Private/Out-QRImage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function Out-QRImage {
If (-not ($Path)) {

#Default to TEMP if path not provided
$Path = [Environment]::GetEnvironmentVariable('Temp')
$Path = [System.IO.Path]::GetTempPath()

}

Expand Down
2 changes: 1 addition & 1 deletion IdentityCommand/Private/Start-AdvanceAuthentication.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Function Start-AdvanceAuthentication {
End {

#Maybe there is a QR Image to clear up
Remove-Item $(Join-Path $([Environment]::GetEnvironmentVariable('Temp')) "$Script:SessionId.html") -ErrorAction SilentlyContinue
Remove-Item $(Join-Path $([System.IO.Path]::GetTempPath()) "$Script:SessionId.html") -ErrorAction SilentlyContinue

}

Expand Down
20 changes: 19 additions & 1 deletion IdentityCommand/Public/New-IDPlatformToken.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,25 @@ Function New-IDPlatformToken {

if ($null -ne $IDSession) {

$IDSession | Add-CustomType -Type IdCmd.ID.PlatformToken
$result = $IDSession | Add-CustomType -Type IdCmd.ID.PlatformToken

#Add GetWebSession ScriptMethod
$result | Add-Member -MemberType ScriptMethod -Name GetWebSession -Value {

Get-IDSession

} -Force

#Add GetToken ScriptMethod to output Bearer Token
$result | Add-Member -MemberType ScriptMethod -Name GetToken -Value {

Write-Output @{Authorization = "$($this.token_type) $($this.access_token)" }

} -Force

#Return the result
$result


}
}
Expand Down
19 changes: 18 additions & 1 deletion IdentityCommand/Public/New-IDSession.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,24 @@ Function New-IDSession {

if ($null -ne $IDSession) {

$IDSession | Select-Object -Last 1 | Add-CustomType -Type IdCmd.ID.Session
$result = $IDSession | Select-Object -Last 1 | Add-CustomType -Type IdCmd.ID.Session

#Add GetWebSession ScriptMethod
$result | Add-Member -MemberType ScriptMethod -Name GetWebSession -Value {

Get-IDSession

} -Force

#Add GetToken ScriptMethod to output Bearer Token
$result | Add-Member -MemberType ScriptMethod -Name GetToken -Value {

Write-Output @{Authorization = "Bearer $($this.Token)" }

} -Force

#Return the result
$result

}

Expand Down
37 changes: 0 additions & 37 deletions IdentityCommand/xml/IdCmd.ID.Session.Types.ps1xml

This file was deleted.

0 comments on commit 0f0d0d7

Please sign in to comment.