1- # see https://github.com/dsccommunity/xHyper-V
1+ # see https://github.com/dsccommunity/HyperVDsc
22configuration HyperV
33{
44 param
@@ -29,7 +29,7 @@ configuration HyperV
2929 )
3030
3131 Import-DscResource - ModuleName PSDesiredStateConfiguration
32- Import-DscResource - ModuleName ' xHyper-V '
32+ Import-DscResource - ModuleName HyperVDsc
3333
3434 [string ]$dependsOnHostOS = $null
3535
@@ -80,7 +80,7 @@ configuration HyperV
8080 $configHyperV.VirtualMachinePath = $VirtualMachinePath
8181 }
8282
83- (Get-DscSplattedResource - ResourceName xVMHost - ExecutionName ' config_HyperVHost' - Properties $configHyperV - NoInvoke).Invoke($configHyperV )
83+ (Get-DscSplattedResource - ResourceName VMHost - ExecutionName ' config_HyperVHost' - Properties $configHyperV - NoInvoke).Invoke($configHyperV )
8484 # endregion
8585
8686 # ######################################################################
@@ -143,7 +143,7 @@ configuration HyperV
143143
144144 $vmswitch.DependsOn = $dependsOnHostOS
145145 $executionName = $vmswitch.Name -replace ' [().:\s]' , ' _'
146- (Get-DscSplattedResource - ResourceName xVMSwitch - ExecutionName " vmswitch_$executionName " - Properties $vmswitch - NoInvoke).Invoke($vmswitch )
146+ (Get-DscSplattedResource - ResourceName VMSwitch - ExecutionName " vmswitch_$executionName " - Properties $vmswitch - NoInvoke).Invoke($vmswitch )
147147
148148 if ($vmswitch.Ensure -ne ' Absent' )
149149 {
@@ -316,7 +316,7 @@ configuration HyperV
316316 result = ' N/A'
317317 }
318318 }
319- DependsOn = " [xVMSwitch ]vmswitch_$executionName "
319+ DependsOn = " [VMSwitch ]vmswitch_$executionName "
320320 }
321321 }
322322
@@ -389,13 +389,13 @@ configuration HyperV
389389 $vmState = $vmmachine.State
390390 $vmmachine.Remove (' State' )
391391
392- $strVMDepend = " [xVMHyperV ]$vmName "
392+ $strVMDepend = " [VMHyperV ]$vmName "
393393 $strVHDPath = " $ ( $vmmachine.Path ) \$vmName \Disks"
394394 $iMemorySize = ($vmmachine.StartupMemory / 1 MB ) * 1 MB
395395
396396 if ($vmmachine.Ensure -eq ' Absent' )
397397 {
398- xVMHyperV $vmName
398+ VMHyperV $vmName
399399 {
400400 Ensure = ' Absent'
401401 Name = $vmName
@@ -454,8 +454,8 @@ configuration HyperV
454454 else
455455 {
456456 $iDiskSize = ($disk.Size / 1 GB ) * 1 GB
457- $strVHDDepend = " [xVHD ]$strVHD "
458- xVHD $strVHD
457+ $strVHDDepend = " [VHD ]$strVHD "
458+ VHD $strVHD
459459 {
460460 Name = $strVHDName
461461 Path = $strVHDPath
@@ -684,9 +684,9 @@ configuration HyperV
684684 $vmmachine.MacAddress = $macAddrList
685685 }
686686
687- (Get-DscSplattedResource - ResourceName xVMHyperV - ExecutionName $vmName - Properties $vmmachine - NoInvoke).Invoke($vmmachine )
687+ (Get-DscSplattedResource - ResourceName VMHyperV - ExecutionName $vmName - Properties $vmmachine - NoInvoke).Invoke($vmmachine )
688688
689- $strVMdepends = " [xVMHyperV ]$vmName "
689+ $strVMdepends = " [VMHyperV ]$vmName "
690690
691691 # additional VM settings
692692 if ($null -ne $checkpointType -or
@@ -952,7 +952,7 @@ configuration HyperV
952952
953953 if ($netAdapter.NetworkSetting -ne $null )
954954 {
955- $netSetting = xNetworkSettings
955+ $netSetting = VMNetworkAdapterNetworkSettings
956956 {
957957 IpAddress = $netAdapter.NetworkSetting.IpAddress
958958 Subnet = $netAdapter.NetworkSetting.Subnet
@@ -979,7 +979,7 @@ configuration HyperV
979979
980980 $execName = " netadapter_$ ( $netAdapter.Id ) "
981981
982- (Get-DscSplattedResource - ResourceName xVMNetworkAdapter - ExecutionName $execName - Properties $netAdapter - NoInvoke).Invoke($netAdapter )
982+ (Get-DscSplattedResource - ResourceName VMNetworkAdapter - ExecutionName $execName - Properties $netAdapter - NoInvoke).Invoke($netAdapter )
983983
984984 Script " $ ( $execName ) _properties"
985985 {
@@ -1044,7 +1044,7 @@ configuration HyperV
10441044 result = ' N/A'
10451045 }
10461046 }
1047- DependsOn = " [xVMNetworkAdapter ]$execName "
1047+ DependsOn = " [VMNetworkAdapter ]$execName "
10481048 }
10491049 }
10501050
@@ -1092,8 +1092,8 @@ configuration HyperV
10921092 else
10931093 {
10941094 $iDiskSize = ($disk.Size / 1 GB ) * 1 GB
1095- $strVHDDepend = " [xVHD ]$strVHD "
1096- xVHD $strVHD
1095+ $strVHDDepend = " [VHD ]$strVHD "
1096+ VHD $strVHD
10971097 {
10981098 Name = $strVHDName
10991099 Path = $disk.Path
@@ -1106,7 +1106,7 @@ configuration HyperV
11061106
11071107 # attach the VHD file to the virtual machine
11081108 $executionName = " $ ( $vmName ) _DiskAttach_$ ( $disk.Name ) "
1109- xVMHardDiskDrive $executionName
1109+ VMHardDiskDrive $executionName
11101110 {
11111111 Ensure = ' Present'
11121112 VMName = $vmName
@@ -1118,7 +1118,7 @@ configuration HyperV
11181118 }
11191119
11201120 ++ $iLocation
1121- $strHddDepends = " [xVMHardDiskDrive ]$executionName "
1121+ $strHddDepends = " [VMHardDiskDrive ]$executionName "
11221122 }
11231123
11241124 # create virtual drives and mount ISO files
@@ -1130,7 +1130,7 @@ configuration HyperV
11301130
11311131 if ($drive.Path.Length )
11321132 {
1133- xVMDvdDrive $executionName
1133+ VMDvdDrive $executionName
11341134 {
11351135 Ensure = ' Present'
11361136 VMName = $vmName
@@ -1142,7 +1142,7 @@ configuration HyperV
11421142 }
11431143 else
11441144 {
1145- xVMDvdDrive $executionName
1145+ VMDvdDrive $executionName
11461146 {
11471147 Ensure = ' Present'
11481148 VMName = $vmName
@@ -1153,7 +1153,7 @@ configuration HyperV
11531153 }
11541154
11551155 ++ $iLocation
1156- $strDvdDepends = " [xVMDvdDrive ]$executionName "
1156+ $strDvdDepends = " [VMDvdDrive ]$executionName "
11571157 }
11581158
11591159 # change boot order: first hdd -> system drive, last dvd -> OS install
0 commit comments