DSCResources/xHyper-V/3.5.0.0/Misc/VMResourceGenerator.ps1
$name = New-xDscResourceProperty -Name Name -Type String -Attribute Key -Description "Name of the VM" $vhdPath = New-xDscResourceProperty -Name VhdPath -Type String -Attribute Required -Description "VHD associated with the VM" $switchName = New-xDscResourceProperty -Name SwitchName -Type String -Attribute Write -Description "Virtual switch associated with the VM" $path = New-xDscResourceProperty -Name Path -Type String -Attribute Write -Description "Folder where the VM data will be stored" $generation = New-xDscResourceProperty -Name Generation -Type String -Attribute Write -ValidateSet "Vhd","Vhdx" -Description "Associated Virtual disk format - Vhd or Vhdx" $ensure = New-xDscResourceProperty -Name Ensure -Type String -Attribute Write -ValidateSet "Present","Absent" -Description "Should the VM be created or deleted" $startupMem = New-xDscResourceProperty -Name StartupMemory -Type Uint64 -Attribute Write -Description "Startup RAM for the VM." $minMem = New-xDscResourceProperty -Name MinimumMemory -Type Uint64 -Attribute Write -Description "Minimum RAM for the VM. This enables dynamic memory." $maxMem = New-xDscResourceProperty -Name MaximumMemory -Type Uint64 -Attribute Write -Description "Maximum RAM for the VM. This enable dynamic memory." $macAddress = New-xDscResourceProperty -Name MACAddress -Type String -Attribute Write -Description "MAC address of the VM." $waitForIP = New-xDscResourceProperty -Name WaitForIP -Type Boolean -Attribute Write -Description "Waits for VM to get valid IP address." $state = New-xDscResourceProperty -Name State -Type String -Attribute Write -ValidateSet "Running","Paused","Off" -Description "State of the VM." $notes = New-xDscResourceProperty -Name Notes -Type String -Attribute Write -Description "Notes about the VM." $procCount = New-xDscResourceProperty -Name ProcessorCount -Type Uint32 -Attribute Write -Description "Processor count for the VM" $restartIfNeeded = New-xDscResourceProperty -Name RestartIfNeeded -Type Boolean -Attribute Write -Description "If specified, shutsdown and restarts the VM if needed for resource change" $id = New-xDscResourceProperty -Name ID -Type String -Attribute Read -Description "VM unique ID" $status = New-xDscResourceProperty -Name Status -Type String -Attribute Read -Description "Status of the VM" $CPUUsage = New-xDscResourceProperty -Name CPUUsage -Type Uint32 -Attribute Read -Description "CPU Usage of the VM" $memAssigned = New-xDscResourceProperty -Name MemoryAssigned -Type Uint64 -Attribute Read -Description "Memory assigned to the VM" $uptime = New-xDscResourceProperty -Name Uptime -Type String -Attribute Read -Description "Uptime of the VM" $creationTime = New-xDscResourceProperty -Name CreationTime -Type DateTime -Attribute Read -Description "Creation time of the VM" $hasDynamicMemory = New-xDscResourceProperty -Name HasDynamicMemory -Type Boolean -Attribute Read -Description "Does VM has dynamic memory enabled" $networkAdapters = New-xDscResourceProperty -Name NetworkAdapters -Type String[] -Attribute Read -Description "Network adapters of the VM" New-xDscResource -Name MSFT_xVMHyperV -Property @($name,$vhdPath,$switchName,$state,$path,$generation,$startupMem,$minMem,$maxMem,$macAddress,$procCount,$waitForIP,$restartIfNeeded,$ensure, $notes,$id,$status,$CPUUsage,$memAssigned,$uptime,$creationTime,$hasDynamicMemory,$networkAdapters) -Path . -ClassVersion 1.0.0 -FriendlyName xVMHyperV |