├── TemplateConfigModule ├── Tests │ └── Acceptance │ │ └── TemplateConfig.Acceptance.Tests.ps1 ├── README.md └── TemplateConfigModule.psd1 ├── README.md ├── ConfigurationData └── TemplateConfig.ConfigData.psd1 ├── LICENSE ├── appveyor.yml └── TemplateConfig.ps1 /TemplateConfigModule/Tests/Acceptance/TemplateConfig.Acceptance.Tests.ps1: -------------------------------------------------------------------------------- 1 | # 2 | -------------------------------------------------------------------------------- /TemplateConfigModule/README.md: -------------------------------------------------------------------------------- 1 | # DSC Configurations Template 2 | 3 | This module contains supporting assets for the script TemplateConfig.ps1. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TemplateConfig DSC Example Configuration Script/Module 2 | 3 | This repo demonstrates how to manage the source for a PowerShell Desired State Configuration script and a corresponding module that contains supporting assets. -------------------------------------------------------------------------------- /ConfigurationData/TemplateConfig.ConfigData.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | AllNodes = @( 3 | @{ 4 | NodeName = 'localhost' 5 | Path = 'c:\file.txt' 6 | Contents = 'this is some text' 7 | GroupName = 'Group1' 8 | } 9 | ) 10 | } 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 PowerShell Team 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build}.0 2 | clone_folder: c:\projects\$(APPVEYOR_PROJECT_NAME) 3 | environment: 4 | TestResultsUploadURI: https://ci.appveyor.com/api/testresults/nunit/$(APPVEYOR_JOB_ID) 5 | ApplicationID: 6 | secure: mHB9K9ItLkpdxUR7WgBnuBiBOl3qgJT1yizvFZDOgkRxvTV5KoZJ8QuAp+F+EbV0 7 | SubscriptionID: 8 | secure: fhB5mHXLFRRc1/iwqCA9ibCqwg7qKqkayknhebLsM+FdlrmL80HCRm1vJYafomei 9 | TenantID: 10 | secure: J/my7xsOE9jewR0DDhD+EU5jeo5Bp83/nmIK8a8QI0QLoZXStCOtk1vUjVsKylW2 11 | ApplicationPassword: 12 | secure: zV3r4bwG65rWRfF1L23RYLj7GXVxsMdZtasCsX0+pYA= 13 | BuildFolder: $(APPVEYOR_BUILD_FOLDER) 14 | ProjectName: $(APPVEYOR_PROJECT_NAME) 15 | ProjectID: $(APPVEYOR_POJECT_ID) 16 | BuildID: $(APPVEYOR_BUILD_ID) 17 | matrix: 18 | fast_finish: true 19 | install: 20 | - git clone https://github.com/powershell/dscconfiguration.tests 21 | - ps: | 22 | Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.205 -Force | Out-Null 23 | Install-Module InvokeBuild -force 24 | build_script: 25 | - ps: | 26 | if (Test-Path -Path .\.build.ps1) { 27 | Invoke-Build -Summary 28 | } 29 | else { 30 | Invoke-Build -File .\dscconfiguration.tests\.build.ps1 -Summary 31 | } 32 | -------------------------------------------------------------------------------- /TemplateConfig.ps1: -------------------------------------------------------------------------------- 1 | 2 | <#PSScriptInfo 3 | 4 | .VERSION 1.0.0.2 5 | 6 | .GUID ba80cc84-9f23-47a8-9ae4-402e3f7e25c7 7 | 8 | .AUTHOR Michael Greene 9 | 10 | .COMPANYNAME Microsoft Corporation 11 | 12 | .COPYRIGHT 13 | 14 | .TAGS DSC Config 15 | 16 | .LICENSEURI https://github.com/PowerShell/TemplateConfig/blob/master/LICENSE 17 | 18 | .PROJECTURI http://github.com/powershell/templateconfig 19 | 20 | .ICONURI 21 | 22 | .EXTERNALMODULEDEPENDENCIES 23 | 24 | .REQUIREDSCRIPTS 25 | 26 | .EXTERNALSCRIPTDEPENDENCIES 27 | 28 | .RELEASENOTES 29 | 30 | 31 | #> 32 | 33 | #Requires -Module TemplateConfigModule 34 | #Requires -Module xPSDesiredStateConfiguration 35 | 36 | <# 37 | 38 | .DESCRIPTION 39 | Example configuration script to demonstrate pairing a PowerShell Desired State Configuration script with a module that contains supporting assets. 40 | 41 | .EXAMPLE 42 | TemplateConfig -configdata c:\dsc\TemplateConfig\ConfigurationData\TemplateConf.configdata.psd1 -outpath c:\dsc\TemplateConfig\MOF 43 | #> 44 | 45 | configuration TemplateConfig 46 | { 47 | Import-DscResource -ModuleName 'PSDesiredStateConfiguration','xPSDesiredStateConfiguration' 48 | 49 | Node $AllNodes.NodeName 50 | { 51 | File testfile 52 | { 53 | Ensure = 'Present' 54 | DestinationPath = $Node.Path 55 | Contents = $Node.Contents 56 | } 57 | 58 | xGroup testGroup 59 | { 60 | Ensure = 'Present' 61 | GroupName = $Node.GroupName 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /TemplateConfigModule/TemplateConfigModule.psd1: -------------------------------------------------------------------------------- 1 | # 2 | # Module manifest for module 'PSGet_TemplateConfigModule' 3 | # 4 | # Generated by: Michael Greene 5 | # 6 | # Generated on: 4/19/2017 7 | # 8 | 9 | @{ 10 | 11 | # Script module or binary module file associated with this manifest. 12 | # RootModule = '' 13 | 14 | # Version number of this module. 15 | ModuleVersion = '1.0.0.3' 16 | 17 | # Supported PSEditions 18 | # CompatiblePSEditions = @() 19 | 20 | # ID used to uniquely identify this module 21 | GUID = 'c6a0e106-3d14-4d8e-bec5-e90050545a5b' 22 | 23 | # Author of this module 24 | Author = 'Michael Greene' 25 | 26 | # Company or vendor of this module 27 | CompanyName = 'Microsoft Corporation' 28 | 29 | # Copyright statement for this module 30 | Copyright = '(c) 2017 Michael Greene. All rights reserved.' 31 | 32 | # Description of the functionality provided by this module 33 | Description = 'This module contains PowerShell Desired State Configuration solutions for deploying and configuring DNS Servers' 34 | 35 | # Minimum version of the Windows PowerShell engine required by this module 36 | PowerShellVersion = '4.0' 37 | 38 | # Name of the Windows PowerShell host required by this module 39 | # PowerShellHostName = '' 40 | 41 | # Minimum version of the Windows PowerShell host required by this module 42 | # PowerShellHostVersion = '' 43 | 44 | # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. 45 | # DotNetFrameworkVersion = '' 46 | 47 | # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. 48 | CLRVersion = '4.0' 49 | 50 | # Processor architecture (None, X86, Amd64) required by this module 51 | # ProcessorArchitecture = '' 52 | 53 | # Modules that must be imported into the global environment prior to importing this module 54 | RequiredModules = @('xPSDesiredStateConfiguration') 55 | 56 | # Assemblies that must be loaded prior to importing this module 57 | # RequiredAssemblies = @() 58 | 59 | # Script files (.ps1) that are run in the caller's environment prior to importing this module. 60 | # ScriptsToProcess = @() 61 | 62 | # Type files (.ps1xml) to be loaded when importing this module 63 | # TypesToProcess = @() 64 | 65 | # Format files (.ps1xml) to be loaded when importing this module 66 | # FormatsToProcess = @() 67 | 68 | # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess 69 | # NestedModules = @() 70 | 71 | # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. 72 | FunctionsToExport = @() 73 | 74 | # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. 75 | CmdletsToExport = @() 76 | 77 | # Variables to export from this module 78 | # VariablesToExport = @() 79 | 80 | # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. 81 | AliasesToExport = @() 82 | 83 | # DSC resources to export from this module 84 | # DscResourcesToExport = @() 85 | 86 | # List of all modules packaged with this module 87 | # ModuleList = @() 88 | 89 | # List of all files packaged with this module 90 | # FileList = @() 91 | 92 | # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. 93 | PrivateData = @{ 94 | 95 | #WindowsOSVersion of this module 96 | WindowsOSVersion = '2012-Datacenter','2012-R2-Datacenter','2016-Datacenter','2016-Nano-Server' 97 | 98 | PSData = @{ 99 | 100 | # Tags applied to this module. These help with module discovery in online galleries. 101 | Tags = 'DSC','Config' 102 | 103 | # A URL to the license for this module. 104 | LicenseUri = 'https://github.com/PowerShell/TemplateConfig/blob/master/LICENSE' 105 | 106 | # A URL to the main website for this project. 107 | ProjectUri = 'https://github.com/PowerShell/TemplateConfig' 108 | 109 | # A URL to an icon representing this module. 110 | # IconUri = '' 111 | 112 | # ReleaseNotes of this module 113 | # ReleaseNotes = '' 114 | 115 | # External dependent modules of this module 116 | # ExternalModuleDependencies = '' 117 | 118 | } # End of PSData hashtable 119 | 120 | } # End of PrivateData hashtable 121 | 122 | # HelpInfo URI of this module 123 | # HelpInfoURI = '' 124 | 125 | # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. 126 | # DefaultCommandPrefix = '' 127 | 128 | } 129 | 130 | --------------------------------------------------------------------------------