forked from PowerShell/DscResource.Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1-Sample_xVMNonLegacyNetworkAdapter_MultipleVM_Config.ps1
76 lines (66 loc) · 1.94 KB
/
1-Sample_xVMNonLegacyNetworkAdapter_MultipleVM_Config.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<#PSScriptInfo
.VERSION 1.2.0
.GUID 0d00c0be-77d1-4170-ae48-7ba5fdd807e7
.AUTHOR Sergei S. Betke
.COMPANYNAME Test-St-Petersburg
.COPYRIGHT Sergei S. Betke
.TAGS DSCConfiguration
.LICENSEURI https://github.com/IT-Service/xITGHyperV//blob/master/LICENSE
.PROJECTURI https://github.com/IT-Service/xITGHyperV/
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES
.PRIVATEDATA
#>
#Requires -Version 4.0
#Requires -Modules 'xITGHyperV'
<#
.SYNOPSIS
Configuration that will create a non legacy NICs in VM 'MyVM01'.
.DESCRIPTION
Configuration that will create a non legacy NICs in VM 'MyVM01'.
.PARAMETER NodeName
The names of one or more Hyper-V nodes to compile a configuration for.
Defaults to 'localhost'.
.EXAMPLE
Sample_xVMNonLegacyNetworkAdapter_MultipleVM
Compiles a configuration that creates non legacy NICs on localhost Hyper-V VM.
#>
Configuration Sample_xVMNonLegacyNetworkAdapter_MultipleVM_Config
{
param
(
[Parameter()]
[System.String[]]
$NodeName = 'localhost'
)
Import-DscResource -ModuleName PSDesiredStateConfiguration
Import-DscResource -ModuleName xITGHyperV -Name xVMNonLegacyNetworkAdapter
node $NodeName
{
xVMNonLegacyNetworkAdapter MyVM01NIC {
Id = 'MyVM01-NIC'
Name = 'MyVM01-NIC'
SwitchName = 'SETSwitch'
VMName = 'MyVM01'
Ensure = 'Present'
}
xVMNonLegacyNetworkAdapter MyVM02NIC {
Id = 'MyVM02-NIC'
Name = 'NetAdapter'
SwitchName = 'SETSwitch'
VMName = 'MyVM02'
Ensure = 'Present'
}
xVMNonLegacyNetworkAdapter MyVM03NIC {
Id = 'MyVM03-NIC'
Name = 'NetAdapter'
SwitchName = 'SETSwitch'
VMName = 'MyVM03'
MacAddress = '99999999'
Ensure = 'Present'
}
}
}