S
S
speedvm2020-07-05 01:54:51
Hyper-V
speedvm, 2020-07-05 01:54:51

WMIC ExportVirtualSystemEx Hyper-V?

Good day!
There is a powershell code:

$vmms = Get-WmiObject MSVM_VirtualSystemManagementService -Namespace "root\virtualization"
$a = 'Msvm_ComputerSystem.CreationClassName="Msvm_ComputerSystem",Name="3A9C5ECB-B5DF-4983-B8BA-4BF5765476FA"'
$vmms.ExportVirtualSystemEx($a, "d:\export\", "")

You need to write a wmic request.
This code doesn't work:
set a=Msvm_ComputerSystem.CreationClassName="Msvm_ComputerSystem",Name="3A9C5ECB-B5DF-4983-B8BA-4BF5765476FA"
wmic /namespace:\\root\virtualization path "Msvm_VirtualSystemManagementService" call ExportVirtualSystemEx %a%,"d:\export\",""

Mistake:
Invalid named parameter list.
Hint: <named param list> ::= <named param> | <named param> <named param list> where <named param> ::= <param name>=<param value>

If you remove or swap single and double quotes, "Description = Invalid method Parameter(s)" or "Invalid format" errors.

PS: The question is to make changes to the batch code in order for it to work, so please answer to the point.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question