powershellwrapper icon indicating copy to clipboard operation
powershellwrapper copied to clipboard

V3 Refactor

Open Celerium opened this issue 4 months ago • 2 comments

Quite a bit got over with this but I've overhauled the ITGlueAPI module. I did this simply because this module got me into writing API wrappers/other PowerShell projects and I wanted to give back to the community as a way of saying thank you.

I have tested every function and the majority of their associated parameters/parameter sets and have not run across any issues yet. With that being said there are a lot of changes and I easily could have missed some things. I have also supplied some generic test scripts in the "examples" folder to help perform general tests when it comes to creating, updating, & deleting data in ITGlue. I labeled this as v3 because while I did my best with backward compatibility, the amount of changes in this PR could cause some breaking changes.

I have working examples for all the changes in my branch over at my repo. This should help with any of the GitHub pages & Azure DevOps pipeline questions. Adjustments will need to be made accordingly if this PR is accepted as GitHub Pages, Azure DevOps, and ReadMe links are dependent on these resources and their specific web URLs.

I am not married to any of the proposed changes I am suggesting and encourage any conversations on anything that could be adjusted.

Issues this PR should resolve

  1. #167 (fixed from previous #162 )
  2. #155 (tab completion added to all supported commands with reference documentation on allowed values depending on parameter set user)
  3. #154 (manual tracking CSV, since ITGlue doesn't offer an API spec)
  4. #153 (All commands and parameters have been converted to PascalCase with backward compatibility in the form of aliases)
  5. #132 (Added to applicable functions)
  6. #108 (Validated/updated attachment functions, everything should be gtg)
  7. #56 (All comment based help should now be in place/up-to-date)
  8. #30 (I believe this is in place now with all the updated function parameters)

Interesting discovery

OTP Passwords #138 (This endpoint showed up a while ago but disappears off and on randomly from their documentation page. ITGlue might be trying to support this but as of 2024-10-07 it is no longer on their developer page again.)

Changes

  • Not an exhausted listed

Pester Tests

  1. Built out more robust tests
  2. Should be compatible with cross-platform
  3. The "tests" folder was moved out of the ITGlueAPI module folder into the root of the repo

GitHub Pages

  1. PowerShell help now redirects to GitHub pages with secondary links going to ITGlues developer documentation
  2. This will have to be turned on for the ITGlue repo "Settings > Pages > Deploy from branch > Master > docs"
  3. Examples found at My repo
  4. Links/formats will need to be adjusted to ITGlue repo. I think I converted the links correctly but it is a little hard to test other repos pages in my PR ;)

Azure DevOps (Pipelines)

  1. Runs cross-platform build tests for various items. Pester tests, help updating, module building...etc
  2. Examples found at My Azure DevOps page

Other changes

  1. Switched from "Internal" & "Resources" to "Public" & "Private"
  2. Module is now compiled into a single "psd1" & "psm1" (See "build > ITGlueAPI > Version#" for details)
  3. Verbose output added to all commands to help with troubleshooting.
  4. Each command will save general function data to global variables to also help with troubleshooting.
  • Example Get-ITGlueUser -ID 8675309
  • $Invoke_ITGlueRequest_Parameters = Information about the API call
  • $Get_ITGlueUser_Parameters = Information about the parameters users
  • $Get_ITGlueUser_ParametersQuery = Information about the query filters used
  1. Functions that modify data now support "ShouldProcess" (Might need some tweaks here)
  2. All functions now have a begin, process, & end to support input processing methods
  3. Some functions now have pipeline support
  • Example 8675309,123456 |Get-ITGlueUser
  1. Examples are consolidated into a single "examples" folder instead of having two different repos.
  2. ReadMe page updated with new information and format (pictures, links..etc)
  3. New and updated Issue & PR templates

Celerium avatar Oct 07 '24 21:10 Celerium