0
votes

I am writing a ps script to export my vms that I manage in svmm to another hdd as a backup.

I tried using Export-VM (http://technet.microsoft.com/en-us/library/hh848491.aspx), but ISE didn't find a matching entry in any module and I can't find any further help on the internet. Here is what I get - sry that it is in German.

PS C:\Users\Usr> Export-VM Export-VM : Die Benennung "Export-VM" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern enthalten), und wiederholen Sie den Vorgang. In Zeile:1 Zeichen:1 + Export-VM + ~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Export-VM:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

Why is that? Thank you in advance!

1
What is your operating system version, and does the system actually have the Hyper-V role installed? Also, you mention "svmm". Do you mean SCVMM? Export-VM is a Hyper-V cmdlet, not an SCVMM cmdlet.Ansgar Wiechers
Oh..well, I have Standart Win7Ultimate SP1 running on my Desktop and MS Hyper-V Server 2012 R2 on the machine I want the script to run on. Do I need to develope it on the server in order for ISE to know the according module?0rube
code completion etc. should work on your local machine but obviously you cant run the commands without having the module availablePaul
Windows 7 doesn't come with Hyper-V, so the Hyper-V module that provides the Export-VM cmdlet isn't available there. You need to run the code on the server, or create a mockup Hyper-V module on the client. Of course the latter won't actually export anything, but it might allow you to test the rest of your script.Ansgar Wiechers

1 Answers

0
votes

Install the SCVMM 2012 R2 console on the workstation that you are wanting to run the Export-VM command on. This will install the appropriate powershell cmdlets, including Export-VM. I've tested this with Windows 7 x64 and SCVMM 2012 R2.

The way you do this is to insert the CD/mount the ISO on the computer you would like to install the console on. Then when you run the install you should have the option to only install the console instead of the full server.