Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
v4.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhitsolutions committed May 4, 2020
1 parent 0994fbf commit 62306cc
Show file tree
Hide file tree
Showing 40 changed files with 547 additions and 329 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ Currently on her public DSC hub located here: https://github.com/majst32/DSC_pub
Additional contributors of note: Jeff Hicks
Disclaimer
This example code is provided without copyright and AS IS. It is free for you to use and modify.
Note: These demos should not be run as a script. These are the commands that I use in the
demonstrations and would need to be modified for your environment.
#>

Expand Down Expand Up @@ -46,6 +43,18 @@ Import-DSCResource -modulename 'xADCSDeployment' -ModuleVersion '1.4.0.0'

#endregion

#region TLS Settings in registry

registry TLS {
Ensure = "present"
Key = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319'
ValueName = 'SchUseStrongCrypto'
ValueData = '1'
ValueType = 'DWord'
}

#endregion

#region IPaddress settings

If (-not [System.String]::IsNullOrEmpty($node.IPAddress)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ Updates for DHCP 2016 Course:
Disclaimer
This example code is provided without copyright and AS IS. It is free for you to use and modify.
Note: These demos should not be run as a script. These are the commands that I use in the
demonstrations and would need to be modified for your environment.
#>

Expand Down Expand Up @@ -192,22 +190,28 @@ WIN10_x86_Enterprise_LTSC_EN_Eval Windows 10 32bit Enterprise LTSC 2019 En
);
NonNodeData = @{
Lability = @{
# EnvironmentPrefix = 'PS-GUI-' # this will prefix the VM names

# You can uncomment this line to add a prefix to the virtual machine name.
# It will not change the guest computername
# See https://github.com/pluralsight/PS-AutoLab-Env/blob/master/Detailed-Setup-Instructions.md
# for more information.

#EnvironmentPrefix = 'AutoLab-'

Network = @( # Virtual switch in Hyper-V
@{ Name = 'LabNet'; Type = 'Internal'; NetAdapterName = 'Ethernet'; AllowManagementOS = $true; }
);
)
DSCResource = @(
## Download published version from the PowerShell Gallery or Github
@{ Name = 'xActiveDirectory'; RequiredVersion = "3.0.0.0"; Provider = 'PSGallery'; },
@{ Name = 'xComputerManagement'; RequiredVersion = '4.1.0.0'; Provider = 'PSGallery'; },
@{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; Provider = 'PSGallery'; },
@{ Name = 'xDhcpServer'; RequiredVersion = '2.0.0.0'; Provider = 'PSGallery'; },
@{ Name = 'xWindowsUpdate' ; RequiredVersion = '2.8.0.0'; Provider = 'PSGallery'; },
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.1.0'; Provider = 'PSGallery'; },
@{ Name = 'xPendingReboot'; RequiredVersion = '0.4.0.0'; Provider = 'PSGallery'; },
@{ Name = 'xADCSDeployment'; RequiredVersion = '1.4.0.0'; Provider = 'PSGallery'; }
);
@{ Name = 'xActiveDirectory'; RequiredVersion = "3.0.0.0"; Provider = 'PSGallery' },
@{ Name = 'xComputerManagement'; RequiredVersion = '4.1.0.0'; Provider = 'PSGallery' },
@{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; Provider = 'PSGallery' },
@{ Name = 'xDhcpServer'; RequiredVersion = '2.0.0.0'; Provider = 'PSGallery' },
@{ Name = 'xWindowsUpdate' ; RequiredVersion = '2.8.0.0'; Provider = 'PSGallery' },
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.1.0'; Provider = 'PSGallery' },
@{ Name = 'xPendingReboot'; RequiredVersion = '0.4.0.0'; Provider = 'PSGallery' },
@{ Name = 'xADCSDeployment'; RequiredVersion = '1.4.0.0'; Provider = 'PSGallery' }
)
Resource = @(
@{

Expand All @@ -217,8 +221,7 @@ WIN10_x86_Enterprise_LTSC_EN_Eval Windows 10 32bit Enterprise LTSC 2019 En
Expand = $false
#DestinationPath = '\software' # Default is resources folder
}
);

};
};
};
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ $Secure = ConvertTo-SecureString -String "$($labdata.allnodes.labpassword)" -AsP
$Domain = "company"
$cred = New-Object PSCredential "Company\Administrator", $Secure

#The prefix only changes the name of the VM not the guest computername
$prefix = $Labdata.NonNodeData.Lability.EnvironmentPrefix

$all = @()
Describe DC1 {

Describe DC1 {

$VMName = "$($prefix)DC1"
Try {
$dc = New-PSSession -VMName DC1 -Credential $cred -ErrorAction Stop
$dc = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
$all += $dc

#set error action preference to suppress all error messsages
Expand Down Expand Up @@ -117,16 +122,18 @@ Describe DC1 {
}
}
Catch {
It "[DC1] Should allow a PSSession" {
It "[DC1] Should allow a PSSession but got error: $($_.exception.message)" {
$false | Should Be $True
}
}
} #DC

Describe S1 {

$VMName = "$($prefix)S1"
Try {

$s1 = New-PSSession -VMName S1 -Credential $cred -ErrorAction Stop
$s1 = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
$all += $s1

#set error action preference to suppress all error messsages
Expand All @@ -146,17 +153,18 @@ Describe S1 {
}
}
Catch {
It "[S1] Should allow a PSSession" {
It "[S1] Should allow a PSSession but got error: $($_.exception.message)" {
$false | Should Be $True
}
}
} #S1

Describe Cli1 {

$VMName = "$($prefix)Cli1"
Try {

$cl = New-PSSession -VMName cli1 -Credential $cred -ErrorAction Stop
$cl = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
$all += $cl

#set error action preference to suppress all error messsages
Expand Down Expand Up @@ -184,17 +192,19 @@ Describe Cli1 {
}
}
Catch {
It "[CLI1] Should allow a PSSession" {
It "[CLI1] Should allow a PSSession but got error: $($_.exception.message)" {
$false | Should Be $True
}
}
} #cli1

Describe Cli2 {

$VMName = "$($prefix)Cli2"

Try {

$cl2 = New-PSSession -VMName cli2 -Credential $cred -ErrorAction Stop
$cl2 = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
$all += $cl2

#set error action preference to suppress all error messsages
Expand All @@ -214,7 +224,7 @@ Describe Cli2 {
}
}
Catch {
It "[CLI2] Should allow a PSSession" {
It "[CLI2] Should allow a PSSession but got error: $($_.exception.message)" {
$false | Should Be $True
}
}
Expand Down
18 changes: 13 additions & 5 deletions Configurations/Jason-DSC-Env/VMConfiguration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ Currently on her public DSC hub located here: https://github.com/majst32/DSC_pub
Additional contributors of note: Jeff Hicks
Disclaimer
This example code is provided without copyright and AS IS. It is free for you to use and modify.
Note: These demos should not be run as a script. These are the commands that I use in the
demonstrations and would need to be modified for your environment.
#>

Configuration AutoLab {
Expand Down Expand Up @@ -47,8 +43,20 @@ Configuration AutoLab {
}

#endregion
#region IPaddress settings

#region TLS Settings in registry

registry TLS {
Ensure = "present"
Key = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319'
ValueName = 'SchUseStrongCrypto'
ValueData = '1'
ValueType = 'DWord'
}

#endregion

#region IPaddress settings

If (-not [System.String]::IsNullOrEmpty($node.IPAddress)) {
xIPAddress 'PrimaryIPAddress' {
Expand Down
42 changes: 22 additions & 20 deletions Configurations/Jason-DSC-Env/VMConfigurationData.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ Currently on her public DSC hub located here: https://github.com/majst32/DSC_pub
Additional contributors of note: Jeff Hicks
Disclaimer
This example code is provided without copyright and AS IS. It is free for you to use and modify.
Note: These demos should not be run as a script. These are the commands that I use in the
demonstrations and would need to be modified for your environment.
#>

Expand Down Expand Up @@ -192,26 +189,32 @@ demonstrations and would need to be modified for your environment.
CustomBootStrap = ''
}

);
)
NonNodeData = @{
Lability = @{
# EnvironmentPrefix = 'PS-GUI-' # this will prefix the VM names

# You can uncomment this line to add a prefix to the virtual machine name.
# It will not change the guest computername
# See https://github.com/pluralsight/PS-AutoLab-Env/blob/master/Detailed-Setup-Instructions.md
# for more information.

#EnvironmentPrefix = 'AutoLab-'

Network = @( # Virtual switch in Hyper-V
@{ Name = 'LabNet'; Type = 'Internal'; NetAdapterName = 'Ethernet'; AllowManagementOS = $true; }
@{ Name = 'LabNet'; Type = 'Internal'; NetAdapterName = 'Ethernet'; AllowManagementOS = $true }
);
DSCResource = @(
## Download published version from the PowerShell Gallery or Github
@{ Name = 'xActiveDirectory'; RequiredVersion = "3.0.0.0"; Provider = 'PSGallery'; },
@{ Name = 'xComputerManagement'; RequiredVersion = '4.1.0.0'; Provider = 'PSGallery'; },
@{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; Provider = 'PSGallery'; },
@{ Name = 'xDhcpServer'; RequiredVersion = '2.0.0.0'; Provider = 'PSGallery'; },
@{ Name = 'xWindowsUpdate' ; RequiredVersion = '2.8.0.0'; Provider = 'PSGallery'; },
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.1.0'; Provider = 'PSGallery'; },
@{ Name = 'xPendingReboot'; RequiredVersion = '0.4.0.0'; Provider = 'PSGallery'; },
@{ Name = 'xADCSDeployment'; RequiredVersion = '1.4.0.0'; Provider = 'PSGallery'; }
@{ Name = 'xActiveDirectory'; RequiredVersion = "3.0.0.0"; Provider = 'PSGallery' },
@{ Name = 'xComputerManagement'; RequiredVersion = '4.1.0.0'; Provider = 'PSGallery' },
@{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; Provider = 'PSGallery' },
@{ Name = 'xDhcpServer'; RequiredVersion = '2.0.0.0'; Provider = 'PSGallery' },
@{ Name = 'xWindowsUpdate' ; RequiredVersion = '2.8.0.0'; Provider = 'PSGallery' },
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.1.0'; Provider = 'PSGallery' },
@{ Name = 'xPendingReboot'; RequiredVersion = '0.4.0.0'; Provider = 'PSGallery' },
@{ Name = 'xADCSDeployment'; RequiredVersion = '1.4.0.0'; Provider = 'PSGallery' }

);
)
Resource = @(
@{
Id = 'Win10RSAT'
Expand All @@ -220,8 +223,7 @@ demonstrations and would need to be modified for your environment.
Expand = $false
#DestinationPath = '\software' # Default is resources folder
}
);

};
};
};
)
}
}
}
32 changes: 22 additions & 10 deletions Configurations/Jason-DSC-Env/VMValidate.test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ $Secure = ConvertTo-SecureString -String "$($labdata.allnodes.labpassword)" -AsP
$Domain = "company"
$cred = New-Object PSCredential "Company\Administrator", $Secure

#The prefix only changes the name of the VM not the guest computername
$prefix = $Labdata.NonNodeData.Lability.EnvironmentPrefix


$all = @()
Describe DC1 {

$VMName = "$($prefix)DC1"
Try {
$dc = New-PSSession -VMName DC1 -Credential $cred -ErrorAction Stop
$dc = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
$all += $dc
#set error action preference to suppress all error messsages
Invoke-Command { $errorActionPreference = 'silentlyContinue'} -session $dc
Expand Down Expand Up @@ -116,15 +120,18 @@ Describe DC1 {
}
}
Catch {
It "[DC1] Should allow a PSSession" {
It "[DC1] Should allow a PSSession but got error: $($_.exception.message)" {
$false | Should Be $True
}
}
} #DC

Describe S1 {

$VMName = "$($prefix)S1"

Try {
$s1 = New-PSSession -VMName S1 -Credential $cred -ErrorAction Stop
$s1 = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
$all += $s1

#set error action preference to suppress all error messsages
Expand All @@ -143,15 +150,17 @@ Describe S1 {
}
}
Catch {
It "[S1] Should allow a PSSession" {
It "[S1] Should allow a PSSession but got error: $($_.exception.message)" {
$false | Should Be $True
}
}
} #S1

Describe S2 {

$VMName = "$($prefix)S2"
Try {
$s2 = New-PSSession -VMName S2 -Credential $cred -ErrorAction Stop
$s2 = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
$all += $s2
#set error action preference to suppress all error messsages
Invoke-Command { $errorActionPreference = 'silentlyContinue'} -session $s2
Expand All @@ -169,15 +178,17 @@ Describe S2 {
}
}
Catch {
It "[S2] Should allow a PSSession" {
It "[S2] Should allow a PSSession but got error: $($_.exception.message)" {
$false | Should Be $True
}
}
} #S2

Describe PullServer {

$VMName = "$($prefix)PullServer"
Try {
$PullServer = New-PSSession -VMName PullServer -Credential $cred -ErrorAction Stop
$PullServer = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
$all += $PullServer
#set error action preference to suppress all error messsages
Invoke-Command { $errorActionPreference = 'silentlyContinue'} -session $pullserver
Expand All @@ -203,8 +214,9 @@ Describe PullServer {

Describe Cli1 {

$VMName = "$($prefix)Cli1"
Try {
$cl = New-PSSession -VMName cli1 -Credential $cred -ErrorAction Stop
$cl = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
$all += $cl
#set error action preference to suppress all error messsages
Invoke-Command { $errorActionPreference = 'silentlyContinue'} -session $cl
Expand All @@ -229,7 +241,7 @@ Describe Cli1 {
}
}
Catch {
It "[CLI1] Should allow a PSSession" {
It "[CLI1] Should allow a PSSession but got error: $($_.exception.message)" {
$false | Should Be $True
}
}
Expand Down
Loading

0 comments on commit 62306cc

Please sign in to comment.