-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add DNS suffixes resource * Add missing parameter attribtue
- Loading branch information
Showing
4 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@{ | ||
RootModule = 'DnsSuffixes.schema.psm1' | ||
|
||
ModuleVersion = '0.0.1' | ||
|
||
GUID = '20392fe9-270d-4295-af2c-2401dd015596' | ||
|
||
Author = 'NA' | ||
|
||
CompanyName = 'NA' | ||
|
||
Copyright = 'NA' | ||
|
||
DscResourcesToExport = @('DnsSuffixes') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
configuration DnsSuffixes | ||
{ | ||
param | ||
( | ||
[Parameter(Mandatory = $true)] | ||
[hashtable[]] | ||
$Suffixes | ||
) | ||
|
||
Import-DscResource -ModuleName NetworkingDsc -Name DnsConnectionSuffix | ||
|
||
foreach ($suffix in $Suffixes) | ||
{ | ||
# Remove Case Sensitivity of ordered Dictionary or Hashtables | ||
$suffix = @{} + $suffix | ||
|
||
if (-not $suffix.ContainsKey('Ensure')) | ||
{ | ||
$suffix.Ensure = 'Present' | ||
} | ||
|
||
$executionName = "dnssuffix_$($suffix.InterfaceAlias)_$($suffix.ConnectionSpecificSuffix)" -replace '[()-.:\s]', '_' | ||
|
||
(Get-DscSplattedResource -ResourceName DnsConnectionSuffix -ExecutionName $executionName -Properties $suffix -NoInvoke).Invoke($suffix) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Suffixes: | ||
- InterfaceAlias: en0 | ||
ConnectionSpecificSuffix: contoso.com |