Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Scripts/1_Prereq.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function Get-WindowsBuildNumber {
#region Downloading required Posh Modules
# Downloading modules into Temp folder if needed.

$modules=("ActiveDirectoryDsc","6.3.0"),("xDHCPServer","3.1.1"),("DnsServerDsc","3.0.0"),("NetworkingDSC","9.0.0"),("xPSDesiredStateConfiguration","9.1.0")
$modules=("ActiveDirectoryDsc","6.3.0"),("xDHCPServer","3.1.1"),("DnsServerDsc","3.0.0"),("NetworkingDSC","9.0.0"),("xPSDesiredStateConfiguration","9.1.0"),("xHyper-V","3.18.0")
foreach ($module in $modules){
WriteInfoHighlighted "Testing if modules are present"
$modulename=$module[0]
Expand Down
32 changes: 23 additions & 9 deletions Scripts/2_CreateParentDisks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,9 @@ If (-not $isAdmin) {
New-item -type directory -Path "$mountdir\Windows\Panther" -force
Copy-Item -Path $unattendfile -Destination "$mountdir\Windows\Panther\unattend.xml" -force
Copy-Item -Path "$PSScriptRoot\Temp\DSC\*" -Destination "$mountdir\Program Files\WindowsPowerShell\Modules\" -Recurse -force
WriteInfoHighlighted "`t Adding Hyper-V feature into DC"
#Install Hyper-V feature
Enable-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V -Path "$mountdir"

#Create credentials for DSC

Expand Down Expand Up @@ -682,9 +685,9 @@ If (-not $isAdmin) {
Import-DSCResource -ModuleName NetworkingDSC -ModuleVersion "9.0.0"
Import-DSCResource -ModuleName xDHCPServer -ModuleVersion "3.1.1"
Import-DSCResource -ModuleName xPSDesiredStateConfiguration -ModuleVersion "9.1.0"
Import-DSCResource -ModuleName xHyper-V -ModuleVersion "3.18.0"
Import-DscResource -ModuleName PSDesiredStateConfiguration


Node $AllNodes.Where{$_.Role -eq "Parent DC"}.Nodename

{
Expand Down Expand Up @@ -722,13 +725,23 @@ If (-not $isAdmin) {
DependsOn = "[WindowsFeature]ADDSInstall"
}

WindowsFeature FeatureDNSTools
WindowsFeature Hyper-V-PowerShell
{
Ensure = "Present"
Name = "RSAT-DNS-Server"
DependsOn = "[WindowsFeature]ADDSInstall"
}

Name = "Hyper-V-PowerShell"
}

xVMSwitch VMSwitch
{
Ensure = "Present"
Name = "vSwitch"
Type = "External"
AllowManagementOS = $true
NetAdapterName = "Ethernet"
EnableEmbeddedTeaming = $true
DependsOn = "[WindowsFeature]Hyper-V-PowerShell"
}

ADDomain FirstDS
{
DomainName = $Node.DomainName
Expand Down Expand Up @@ -842,9 +855,11 @@ If (-not $isAdmin) {
IPaddress IP
{
IPAddress = ($DHCPscope+"1/24")
AddressFamily = 'IPv4'
InterfaceAlias = 'Ethernet'
AddressFamily = "IPv4"
InterfaceAlias = "vEthernet (vSwitch)"
DependsOn = "[xVMSwitch]VMSwitch"
}

WindowsFeature DHCPServer
{
Ensure = "Present"
Expand All @@ -866,7 +881,6 @@ If (-not $isAdmin) {
DependsOn = "[WindowsFeature]DHCPServer"
}


xDhcpServerScope ManagementScope
{
Ensure = 'Present'
Expand Down