Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using -DetailedObject on Get-RubrikScvmm containing zero results throws error #556

Closed
mwpreston opened this issue Jan 27, 2020 · 1 comment

Comments

@mwpreston
Copy link
Contributor

Current Behavior:

The null check implemented in Issue 531 is still causing 0 results to throw an error when running Get-RubrikSCVMM with the -DetailedObject flag.G

Get-RubrikSCVMM -DetailedObject -PrimaryClusterID local -Verbose                                                     VERBOSE: Validate the Rubrik token exists                                                                                                   VERBOSE: Found a Rubrik token for authentication                                                                                            VERBOSE: Gather API Data for Get-RubrikScvmm                                                                                                VERBOSE: Selected 1.0 API Data for Get-RubrikScvmm                                                                                          VERBOSE: Load API data for Get-RubrikScvmm                                                                                                  VERBOSE: Description: Returns the known SCVMM servers from Rubrik                                                                           VERBOSE: Build the URI                                                                                                                      VERBOSE: URI = https://192.168.150.121/api/internal/hyperv/scvmm
VERBOSE: Build the query parameters for effective_sla_domain_id,primary_cluster_id,sla_assignment
VERBOSE: URI = https://192.168.150.121/api/internal/hyperv/scvmm?primary_cluster_id=local
VERBOSE: Submitting the request
VERBOSE: GET https://192.168.150.121/api/internal/hyperv/scvmm?primary_cluster_id=local with 0-byte payload
VERBOSE: received 37-byte response of content type application/json; charset=UTF-8
VERBOSE: Received HTTP Status 200
VERBOSE: Formatting return value
VERBOSE: Filter the results
VERBOSE: Filter match = Name
VERBOSE: Applying Rubrik.Scvmm TypeName to results
Get-RubrikScvmm : Cannot validate argument on parameter 'Id'. The argument is null or empty. Provide an argument that is not null or
empty, and then try the command again.
At C:\gitrepo\rubrik-sdk-for-powershell\Rubrik\Public\Get-RubrikScvmm.ps1:129 char:31
+           Get-RubrikScvmm -id $result[$i].id
+                               ~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-RubrikScvmm], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Get-RubrikScvmm

Expected Behavior:
Expect the cmdlet to simply return nothing
Steps to Reproduce:
Run Get-RubrikSCVMM -detailedobject against a cluster with no SCVMM servers

@shamsway
Copy link
Contributor

Resolved by #557

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants