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

Remove-ZertoVpgVm not working as expected #118

Open
reggroux opened this issue Aug 6, 2021 · 0 comments
Open

Remove-ZertoVpgVm not working as expected #118

reggroux opened this issue Aug 6, 2021 · 0 comments

Comments

@reggroux
Copy link

reggroux commented Aug 6, 2021

Right now Remove-ZertoVpgVm is not working for me. When I run a command such as

Remove-ZertoVpgVm -VpgName 'test-vpg' -Vm 'test-vm'

I get the following error.

Method invocation failed because [System.Management.Automation.PSCustomObject] does not contain a method named 'Where'.
At C:\Program Files\WindowsPowerShell\Modules\ZertoApiWrapper\1.5.3\ZertoApiWrapper.psm1:5955 char:17
+ ...             $protectedVms.Where( { $_.VmName -like $machine }) | Sele ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Where:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound
 
WARNING: No VMs found to remove. Please check your parameters and try again.

To fix this I had to adjust Remove-ZertoVpgVm.ps1 line 33

From
$protectedVms.Where( { $_.VmName -like $machine }) | Select-Object -ExpandProperty VmIdentifier

To

$protectedVms | Where-Object ( { $_.VmName -like $machine }) | Select-Object -ExpandProperty VmIdentifier

I don't know enough to explain why this fixes the issue I just figured it out by messing around with the code.

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

No branches or pull requests

1 participant