Simple Example

Jan 23, 2009 at 11:28 AM
I can't see examples of using these new commands anywhere? Is there no help accessible from the powershell "export-vm /?" or something?
I am new to this kind of stuff, can someone tell me what form these commands need to take, maybe an example of how to use export-vm?

Jan 23, 2009 at 3:39 PM
I'm starting to look at this library myself.  The library itself has some examples:
PS> get-content hyperv.ps1|select-string -pattern "ping-vm"

Filter Ping-VM
 if ($VM -is [Array])  {$VM | foreach-Object {Ping-VM $_ -Server $Server} }
#Example 1: Ping-VM "Tenby" -server james2008
#Example 2: get-vm -r | foreach-object {if ((Ping-VM $_).statusCode -ne 0) {"$($_.elementname) is inaccessible"} }

There doesn't appear to be an examples for export-vm though.

The way this was actually implemented, there isn't any way to actually get any help like you mention.

That being said, this library could be improved in this way...

Windows PowerShell MVP

Jan 26, 2009 at 5:17 PM
Edited Jan 30, 2009 at 12:46 AM
As part of the 1.0 release there is now some documentation ... which started with using select-string as shown by Marco to get the existing examples from the script.