Skip to content

Commit d3f1fd3

Browse files
🩹 [Patch]: Depend on the Hashtable module (#311)
## Description This pull request includes the replacement of several utility functions related to hashtable operations in favor of the `Hashtable` module, and a minor modification to the `Invoke-GitHubAPI` function. Removal of utility functions: * [`src/functions/private/Utilities/Hashtable/ConvertFrom-HashTable.ps1`](diffhunk://#diff-2c320fb700a18cfc9b5fef0345ce135d7f188baac4d30d716eb6cea584dc1f24L1-L57): Removed the `ConvertFrom-HashTable` function, which converted a hashtable to a `pscustomobject`. * [`src/functions/private/Utilities/Hashtable/ConvertTo-HashTable.ps1`](diffhunk://#diff-7a5a2af4d68fcce170d1641cd122aa584cdee0382ade78fbc56efba81980dee1L1-L80): Removed the `ConvertTo-HashTable` function, which converted an object to a hashtable. * [`src/functions/private/Utilities/Hashtable/Join-Object.ps1`](diffhunk://#diff-bfcc65f08caa575898873a40402d0c40f4deec2506669c9e89201e1260abc0d9L1-L104): Removed the `Join-Object` function, which merged multiple objects into a single object. * [`src/functions/private/Utilities/Hashtable/Remove-HashtableEntry.ps1`](diffhunk://#diff-09fd42bcd068f70e9d3430dfa7aa1aa55ffa11051533e6cdd83b8e0b5a087dcdL1-L103): Removed the `Remove-HashtableEntry` function, which removed entries from a hashtable based on various criteria. Modification to `Invoke-GitHubAPI` function: * [`src/functions/public/API/Invoke-GitHubAPI.ps1`](diffhunk://#diff-9285dd3cdd5467d93c8e68c989041171e17993971649b877dce001b1861b2c39R2): Added a module requirement for `Hashtable` and modified the debug output to directly cast `$APICall` to `pscustomobject` instead of using the removed `ConvertFrom-HashTable` function. [[1]](diffhunk://#diff-9285dd3cdd5467d93c8e68c989041171e17993971649b877dce001b1861b2c39R2) [[2]](diffhunk://#diff-9285dd3cdd5467d93c8e68c989041171e17993971649b877dce001b1861b2c39L165-R166) ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 5e2a48d commit d3f1fd3

File tree

7 files changed

+2
-349
lines changed

7 files changed

+2
-349
lines changed

.github/workflows/Process-PSModule.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,3 @@ jobs:
3636
TEST_USER_ORG_FG_PAT: ${{ secrets.TEST_USER_ORG_FG_PAT }}
3737
TEST_USER_USER_FG_PAT: ${{ secrets.TEST_USER_USER_FG_PAT }}
3838
TEST_USER_PAT: ${{ secrets.TEST_USER_PAT }}
39-
with:
40-
Verbose: true
41-
Debug: true

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# GitHub PowerShell
22

3-
43
The module provides a PowerShell-flavored approch to managing and automating your GitHub environments. It's tailored for developers, administrators,
54
and GitHub enthusiasts who want to use PowerShell to integrate or manage GitHub seamlessly.
65

src/functions/private/Utilities/Hashtable/ConvertFrom-HashTable.ps1

Lines changed: 0 additions & 57 deletions
This file was deleted.

src/functions/private/Utilities/Hashtable/ConvertTo-HashTable.ps1

Lines changed: 0 additions & 80 deletions
This file was deleted.

src/functions/private/Utilities/Hashtable/Join-Object.ps1

Lines changed: 0 additions & 104 deletions
This file was deleted.

src/functions/private/Utilities/Hashtable/Remove-HashtableEntry.ps1

Lines changed: 0 additions & 103 deletions
This file was deleted.

src/functions/public/API/Invoke-GitHubAPI.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#Requires -Modules @{ ModuleName = 'Uri'; RequiredVersion = '1.1.0' }
2+
#Requires -Modules @{ ModuleName = 'Hashtable'; RequiredVersion = '1.1.5' }
23

34
filter Invoke-GitHubAPI {
45
<#
@@ -162,7 +163,7 @@ filter Invoke-GitHubAPI {
162163
try {
163164
Write-Debug '----------------------------------'
164165
Write-Debug 'Request:'
165-
$APICall | ConvertFrom-HashTable | Format-List | Out-String -Stream | ForEach-Object { Write-Debug $_ }
166+
[pscustomobject]$APICall | Format-List | Out-String -Stream | ForEach-Object { Write-Debug $_ }
166167
Write-Debug '----------------------------------'
167168
do {
168169
switch ($TokenType) {

0 commit comments

Comments
 (0)