mbegan / Okta-PSModule

Okta API Powershell Wrapper Module
Other
102 stars 31 forks source link

Suggestions for improving the Okta Module #10

Open orion3311 opened 7 years ago

orion3311 commented 7 years ago

First off, thanks for posting it up! I used this yesterday to tackle some issues. I also made a modification to it to add the app-delete function (using your original code for getappbyid). That said, I have some comments/suggestions that would make it a little better...

  1. Change functions so that they'd accept input from pipeline (may be easy) 1a. Change the "aid" parameter for things like getoktaappbyid where the actual parameter is just id, not aid. That would help in allowing input from the pipeline, as okta outputs just the id, not as "aid".
  2. Change commands so that they're unique, but follow the Powershell verb-noun standard, maybe something like get-oktaapp or something like that. (This is a nitpick)

Lastly, I can send you what I did to add the OKTA Delete app code, but in reality, I just copied the "getoktaappbyid" function, changed the "aid" parameter to be just "id", changed the METHOD to "DELETE", and added "ValueFromPipelineByPropertyName=$true" to the ID parameter to let it input from the pipeline.

The one thing that should be added though, is some sort of confirmation somehow. In my use case, I wanted to clear out ALL inactive apps (I had about 70), so I use the oktalistapps to get the list of inactive apps, then piped it to the oktadeleteapp function I created (using foreach-object) to wipe them out. Thankfully OKTA will only allow inactive apps to be deleted, but its dangerous nonetheless, especially in a larger enviroment with hundreds of inactive apps that may be just getting tested/developed.

vikashdaya commented 7 years ago

Okta have published Early Release of Policy API. Would be good to get that functionality into the powershell module.

finackninja commented 4 years ago

Agreed. It would be nice if this module followed PowerShell best practices guidance for cmdlet naming: