rubrikinc / rubrik-sdk-for-powershell

Rubrik Module for PowerShell
https://build.rubrik.com/sdks/powershell/
MIT License
102 stars 87 forks source link

Get-RubrikRequest should consider CANCELLED as an exit condition #794

Closed IamTHEvilONE closed 2 years ago

IamTHEvilONE commented 2 years ago

https://github.com/rubrikinc/rubrik-sdk-for-powershell/blob/5f1950b47d362319a642c21aeced4daa6ee9adfa/Rubrik/Public/Get-RubrikRequest.ps1#L137

Steps to reproduce:

  1. Create a job that takes some time to complete. (New-RubrikSnapshot)
  2. Pipe that to Get-RubrikRequest -WaitForCompletion so that we are in the wait loop.
  3. Cancel the job via some other method (different PoSH session or Rubrik's GUI)

The wait loop doesn't break due to missing the exit condition of cancelled ... the code just waits for Success or Failure.

jaapbrasser commented 2 years ago

That's a good addition, thanks for that suggestion I've picked it up and it will be merged shortly!