Open orion3311 opened 7 years ago
Okta have published Early Release of Policy API. Would be good to get that functionality into the powershell module.
Agreed. It would be nice if this module followed PowerShell best practices guidance for cmdlet naming:
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...
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.