0

I have a Windows Server 2008R2 running SCVMM 2012. I successfully removed a virtual machine, according to the Jobs output from VMM, as seen in this screenshot.

enter image description here

As you can see, the VM has a red dot indicating a failure. VMM doesn't really mention it anywhere. I can only see it as a failed disk under the Failover Cluster Manager on any off the cluster nodes.

How can I retrieve this information using PowerShell?
If I do:

Get-Job -All -Full | Where-Object { $_.Name -contains "Remove virtual machine" }

I get a lot of information about this particular job, but I cannot find the Property, Previous Value, or New Value which are listed under the Summary tab.
How can I extract these details about this VM?

slybloty
  • 443
  • 2
  • 9
  • 30

1 Answers1

-1

-contains operator should be used for collections(arrays or others) so it is likely you are looking at a wrong object. From http://technet.microsoft.com/en-gb/library/hh847759.aspx:

-Contains

Description: Containment operator. Tells whether a collection of reference values includes a single test value. Always returns a Boolean value. Returns TRUE only when the test value exactly matches at least one of the reference values.

Try this:

Get-Job -All -Full | Where-Object { $_.Name -match "Remove virtual machine" }
Raf
  • 308
  • 1
  • 8
  • I understand the difference between `-match` and `-contains` and thanks for pointing that out, but not even this way I can't retrieve the needed information. It returns the same. – slybloty Aug 14 '14 at 18:32