rubrikinc / rubrik-sdk-for-powershell

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

Get-RubrikVM (VM name) |get-Rubrik Snapshot -latest not working in a script #833

Open zencpu opened 1 year ago

zencpu commented 1 year ago

When I run the command from the PowerShell command line, it works great. If I try putting it in a script to loop through a bunch of VMs, it comes back with the following error:

Get-Rubrik Snapshot : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.

For some reason, the Get-Rubriksnapshot is able to get the information from the Get-Rubrik VM output.

Anyone able to assist with why it works command line, but not in a script?

mwpreston commented 2 months ago

HI @zencpu - Can you post your script?

Get-RubrikVM MyVM | Get-RubrikSnapshot -Latest works fine for me - where MyVM is the name of a VM