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

Get-RscType -InitialProperties fails to init more than one nested property #112

Open
rynardtspies opened this issue Jun 20, 2024 · 0 comments · Fixed by #113
Open

Get-RscType -InitialProperties fails to init more than one nested property #112

rynardtspies opened this issue Jun 20, 2024 · 0 comments · Fixed by #113
Assignees

Comments

@rynardtspies
Copy link
Collaborator

Issue Description

When using Get-RscType to initialize properties of an object, if multiple nested properties are requested for a nested type, only the first property of the nested property tree is initialized. Subsequent properties return a null reference exception.

Steps to Reproduce

  1. Initialize properties with a single nested property:

    $fields = Get-RscType -Name VsphereVm -InitialProperties @("id", "name", "vsphereVirtualDisks.nodes.Fid")
    $fields.VsphereVirtualDisks.Nodes[0]

    Output:

    CdmId                :
    CdmVersion           :
    ClusterUuid          :
    DatastoreFid         :
    DeviceKey            :
    ExcludeFromSnapshots :
    Fid                  : FETCH
    FileName             :
    Size                 :
    VirtualMachineId     :
    Datastore            :
    
  2. Initialize properties with another single nested property:

    $fields = Get-RscType -Name VsphereVm -InitialProperties @("id", "name", "vsphereVirtualDisks.nodes.FileName")
    $fields.VsphereVirtualDisks.Nodes[0]

    Output:

    CdmId                :
    CdmVersion           :
    ClusterUuid          :
    DatastoreFid         :
    DeviceKey            :
    ExcludeFromSnapshots :
    Fid                  :
    FileName             : FETCH
    Size                 :
    VirtualMachineId     :
    Datastore            :
    
  3. Initialize properties with multiple nested properties:

    $fields = Get-RscType -Name VsphereVm -InitialProperties @("id", "name", "vsphereVirtualDisks.nodes.FileName", "vsphereVirtualDisks.nodes.Fid")

    Output:

    Get-RscType: Object reference not set to an instance of an object.
    $fields.VsphereVirtualDisks.Nodes[0]
    
    CdmId                :
    CdmVersion           :
    ClusterUuid          :
    DatastoreFid         :
    DeviceKey            :
    ExcludeFromSnapshots :
    Fid                  :
    FileName             : FETCH
    Size                 :
    VirtualMachineId     :
    Datastore            :
    

Expected Behavior

Both vsphereVirtualDisks.nodes.FileName and vsphereVirtualDisks.nodes.Fid should be initialized without causing a null reference exception.

Actual Behavior

Only the first property (FileName or Fid) is initialized, and attempting to initialize multiple nested properties results in a null reference exception.


@rynardtspies rynardtspies self-assigned this Jun 20, 2024
@rynardtspies rynardtspies linked a pull request Jun 20, 2024 that will close this issue
evcheng-rubrik added a commit that referenced this issue Jun 25, 2024
New Features:
  - Get-RscWorkload cmdlet - Retrieves information about any supported workload type, with various filtering capabilities.
  - Get-RscVmwareVm - Added -Relic switch. Use -Relic:$false to filter out Relics. -Relic will return only Relics. No usage of -Relic will return all (default operation). -Name parameter is now position 0, so you don't have to specify -Name.
  - Get-RscNutanixVm - New cmdlet to get Nutanix VMs
  - Register-RscRubrikBackupService - New cmdlet to register RBS on VMs
  - Get-RscRole - Gets list of RSC Roles
  - Get-RscPermission - Gets list of RSC Permissions from Role
  - New-RscPermission - Creates new RSC Permission object
  - Merge-RscPermission - Merges an RSC Permission object into a Role object
  - Set-RscRole - Updates a Role in RSC with a Role object
  - New-RscSla - Now accepts -DailySchedule as a parameter

Fixes:
  - Issue [#112](#112)

Breaking Changes:

 - Removed legacy Get-RscVsphereVm CS cmdlet. Please use Get-RscVmwareVm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant