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

Export-RubrikVM cmdlet's -PowerOn switch defaults to true but should be false. #594

Closed
Kyle-Payne opened this issue Mar 27, 2020 · 2 comments · Fixed by #595
Closed

Export-RubrikVM cmdlet's -PowerOn switch defaults to true but should be false. #594

Kyle-Payne opened this issue Mar 27, 2020 · 2 comments · Fixed by #595

Comments

@Kyle-Payne
Copy link

Current Behavior:

When using the Export-RubrikVM cmdlet the VMs power on even if you do NOT pass the -PowerOn switch. Looking at the help it appears this switch is incorrectly set with a default of true. This means if you don't pass the switch the VM Powers On and if you do pass the switch the VM Powers On. There is no way to ensure the VM doesn't Power On.

-PowerOn [<SwitchParameter>]
        Whether the VM should be powered on after restoration. Default is true.
 
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  False


Expected Behavior:
It is expect if you do not pass the switch -PowerOn then the VM will not Power On after it has been exported.

Steps to Reproduce:

Please provide detailed steps for reproducing the issue.

  1. Use the cmdlet Export-RubrikVM without adding the -PowerOn switch and you will see the VM still powers on.

Context:

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Rubrik PowerShell Module Version: Use Get-Module -ListAvailable Rubrik
  • PowerShell Version: Use $PSVersiontable.PSVersion
  • Operating System: Use $PSVersiontable.PSVersion on PowerShell 6 and later, use (Get-WMIObject win32_operatingsystem).Name for Windows PowerShell

Rubrik PowerShell Module Version: 5.0.1
PowerShell Version: 5 1 18362 628
OS System: 5 1 18362 628

Failure Logs

Please include any relevant log snippets or files here, IMPORTANT all information will be visible publicly on GitHub. Do not include computer or user names, passwords, API tokens or any identifiable information when submitting failure logs.

@jaapbrasser
Copy link
Contributor

Thanks for reporting this @Kyle-Payne, I'll take a look at the code and see how we can best resolve this.

@jaapbrasser
Copy link
Contributor

Hello Kyle,

I have created a pull request with updated code, could you validate if this resolves your issue for you @Kyle-Payne?

PR is linked here: #595

mwpreston added a commit that referenced this issue Mar 30, 2020
Issue 594 Export-RubrikVM cmdlet's -PowerOn switch defaults to true Close #594
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants