Currently, the instructions are to dot-source the GroupPolicy.ps1 script. Dot-sourcing still works, but it's not Microsoft's recommendation and people new to PowerShell don't like the syntax of using a single period as a command.
Suggestion: rename the extension of GroupPolicy.ps1 to GroupPolicy.psm1, then use the Import-Module cmdlet instead of dot-sourcing, like this:
Using the Import-Module cmdlet like this has been supported since PowerShell 2.0.
In the long run, hopefully this whole SHB project will become a package in the PowerShell Gallery (www.powershellgallery.com) as a "proper" module in its own folder, etc., but the above change can be done immediately.
I've tested the above change on Server 2016 and there were no new error messages (the current errors related to ADMX/ADML files and GPO imports are already known).
Hello IAD:
Currently, the instructions are to dot-source the GroupPolicy.ps1 script. Dot-sourcing still works, but it's not Microsoft's recommendation and people new to PowerShell don't like the syntax of using a single period as a command.
Suggestion: rename the extension of GroupPolicy.ps1 to GroupPolicy.psm1, then use the Import-Module cmdlet instead of dot-sourcing, like this:
Import-Module -Name .\Secure-Host-Baseline\Scripts\GroupPolicy.psm1
Using the Import-Module cmdlet like this has been supported since PowerShell 2.0.
In the long run, hopefully this whole SHB project will become a package in the PowerShell Gallery (www.powershellgallery.com) as a "proper" module in its own folder, etc., but the above change can be done immediately.
I've tested the above change on Server 2016 and there were no new error messages (the current errors related to ADMX/ADML files and GPO imports are already known).
Cheers, Jason