diff --git a/ConfigurationData.SIMPLE.psd1 b/ConfigurationData.SIMPLE.psd1 new file mode 100644 index 0000000..2bebc3b --- /dev/null +++ b/ConfigurationData.SIMPLE.psd1 @@ -0,0 +1,23 @@ +@{ + AllNodes = @( + @{ + NodeName = 'CLIENT1'; + Role = 'CLIENT'; + InterfaceAlias = 'Ethernet'; + AddressFamily = 'IPv4'; + Lability_SwitchName = "Wifi-HyperV-VSwitch"; + Lability_Media = 'WIN10_x64_Enterprise_EN_Eval'; + Lability_ProcessorCount = 1; + Lability_StartupMemory = 2GB; + PSDscAllowPlainTextPassword = $true; + } + ); + NonNodeData = @{ + Lability = @{ + DSCResource = @( + @{ Name = 'xComputerManagement'; RequiredVersion = '4.1.0.0'; } + @{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; } + ); + }; + }; +}; \ No newline at end of file diff --git a/Configure.SIMPLE.ps1 b/Configure.SIMPLE.ps1 new file mode 100644 index 0000000..aa7655d --- /dev/null +++ b/Configure.SIMPLE.ps1 @@ -0,0 +1,51 @@ +Configuration SimpleConfig { + param () + + Import-DscResource -Module PSDesiredStateConfiguration + + Import-DscResource -Module xComputerManagement -ModuleVersion 4.1.0.0 + Import-DscResource -Module xNetworking -ModuleVersion 5.7.0.0 + + # Common configuration for all nodes + node $AllNodes.Where({$_.Role -in 'CLIENT'}).NodeName { + + # Configure the DSC LocalConfigurationManager (LCM) + # In general, Lability configs will use an LCM section like this + # Details for configuring the LCM can be found at + # + LocalConfigurationManager { + RebootNodeIfNeeded = $true; + AllowModuleOverwrite = $true; + ConfigurationMode = 'ApplyOnly'; + } + + # Enable ICMP ECHO (aka ping) requests over IPv4 + xFirewall 'FPS-ICMP4-ERQ-In' { + Name = 'FPS-ICMP4-ERQ-In'; + DisplayName = 'File and Printer Sharing (Echo Request - ICMPv4-In)'; + Description = 'Echo request messages are sent as ping requests to other nodes.'; + Direction = 'Inbound'; + Action = 'Allow'; + Enabled = 'True'; + Profile = 'Any'; + } + + # Enable ICMP ECHO (aka ping) requests over IPv6 + xFirewall 'FPS-ICMP6-ERQ-In' { + Name = 'FPS-ICMP6-ERQ-In'; + DisplayName = 'File and Printer Sharing (Echo Request - ICMPv6-In)'; + Description = 'Echo request messages are sent as ping requests to other nodes.'; + Direction = 'Inbound'; + Action = 'Allow'; + Enabled = 'True'; + Profile = 'Any'; + } + + # Set the VM's hostname + xComputer 'Hostname' { + Name = $node.NodeName; + } + + } + +} \ No newline at end of file diff --git a/Deploy-SIMPLE.ps1 b/Deploy-SIMPLE.ps1 new file mode 100644 index 0000000..e91e344 --- /dev/null +++ b/Deploy-SIMPLE.ps1 @@ -0,0 +1,12 @@ +[CmdletBinding()] Param() + +$ErrorActionPreference = "Stop" + +$configData = "$PSScriptRoot\ConfigurationData.SIMPLE.psd1" +. $PSScriptRoot\Configure.SIMPLE.ps1 +& SimpleConfig -ConfigurationData $configData -OutputPath $env:LabilityConfigurationPath -Verbose + +$adminPassword = Read-Host -AsSecureString -Prompt "Admin password" +$adminCred = New-Object -TypeName PSCredential -ArgumentList @("IgnoredUsername", $adminPassword) +Start-LabConfiguration -ConfigurationData $configData -Path $env:LabilityConfigurationPath -Verbose -Credential $adminCred +Start-Lab -ConfigurationData $configData -Verbose \ No newline at end of file