All, I seem to be stumped on something that should be easy. I imagine it stems from a lack of understanding of Get-View.
I am trying to modify the vCheck v3 script from virtu-al. In it he uses the line below to get the views of the VM's. I only want the views of the VM's in a specific datastore. I have been able to modify the rest of the code, but I'm stuck here.
$FullVM = Get-View -ViewType VirtualMachine | Where {-not $_.Config.Template}
I've tried: $FullVM = Get-Datacenter <DATACENTER> | Get-View -ViewType VirtualMachine | Where {-not $_.Config.Template} without luck. Error follows:
Get-View : 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.
At line:1 char:25
+ $FullVM = $DC | Get-View <<<< -ViewType VirtualMachine | Where {-not $_.Config.Template}
+ CategoryInfo : InvalidArgument: (Server Management Denver:PSObject) Get-View, ParameterBindingExcepti
on
+ FullyQualifiedErrorId : InputObjectNotBound,VMware.VimAutomation.Commands.DotNetInterop.GetVIView
Any help would be appreciated, Josh