From ce964972aec37ca65adfe121deb959fe1706669d Mon Sep 17 00:00:00 2001 From: Robert Gouge Date: Mon, 15 Jul 2019 08:23:52 -0500 Subject: [PATCH 1/5] Add comments from the Mof to each parameter --- .../MSFT_xWaitForADDomain.psm1 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 b/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 index f97f4978e..9ebe9e582 100644 --- a/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 +++ b/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 @@ -11,22 +11,28 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( + + # The name of the Active Directory domain to wait for. [Parameter(Mandatory = $true)] [System.String] $DomainName, + # The user account credentials to use to perform this task. [Parameter()] [System.Management.Automation.PSCredential] $DomainUserCredential, + # The interval in seconds between retry attempts. Default value is 60. [Parameter()] [System.UInt64] $RetryIntervalSec = 60, + # The number of retries before failing. Default value is 10. [Parameter()] [System.UInt32] $RetryCount = 10, + # The number of times to reboot after failing and then restart retrying. Default value is 0 (zero). [Parameter()] [System.UInt32] $RebootRetryCount = 0 @@ -72,22 +78,27 @@ function Set-TargetResource [CmdletBinding()] param ( + # The name of the Active Directory domain to wait for. [Parameter(Mandatory = $true)] [System.String] $DomainName, + # The user account credentials to use to perform this task. [Parameter()] [System.Management.Automation.PSCredential] $DomainUserCredential, + # The interval in seconds between retry attempts. Default value is 60. [Parameter()] [System.UInt64] $RetryIntervalSec = 60, + # The number of retries before failing. Default value is 10. [Parameter()] [System.UInt32] $RetryCount = 10, + # The number of times to reboot after failing and then restart retrying. Default value is 0 (zero). [Parameter()] [System.UInt32] $RebootRetryCount = 0 @@ -152,22 +163,27 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( + # The name of the Active Directory domain to wait for. [Parameter(Mandatory = $true)] [System.String] $DomainName, + # The user account credentials to use to perform this task. [Parameter()] [System.Management.Automation.PSCredential] $DomainUserCredential, + # The interval in seconds between retry attempts. Default value is 60. [Parameter()] [System.UInt64] $RetryIntervalSec = 60, + # The number of retries before failing. Default value is 10. [Parameter()] [System.UInt32] $RetryCount = 10, + # The number of times to reboot after failing and then restart retrying. Default value is 0 (zero). [Parameter()] [System.UInt32] $RebootRetryCount = 0 @@ -201,10 +217,12 @@ function Get-Domain [OutputType([PSObject])] param ( + # The name of the Active Directory domain to wait for. [Parameter(Mandatory = $true)] [System.String] $DomainName, + # The user account credentials to use to perform this task. [Parameter()] [System.Management.Automation.PSCredential] $DomainUserCredential From a304a269e72ea0a6f17d60039256ac4507e21063 Mon Sep 17 00:00:00 2001 From: Robert Gouge Date: Mon, 15 Jul 2019 08:41:05 -0500 Subject: [PATCH 2/5] Add commet blocks before each function --- .../MSFT_xWaitForADDomain.psm1 | 69 ++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 b/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 index 9ebe9e582..2df5cdbd6 100644 --- a/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 +++ b/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 @@ -6,6 +6,25 @@ Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath ' $script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xWaitForADDomain' +<# + .SYNOPSIS + Gets the current state of the specified Active Directory to see if it is available. + + .PARAMETER DomainName + The name of the Active Directory domain to wait for. + + .PARAMETER DomainUserCredential + The user account credentials to use to perform this task. + + .PARAMETER RetryIntervalSec + The interval in seconds between retry attempts. Default value is 60. + + .PARAMETER RetryCount + The number of retries before failing. Default value is 10. + + .PARAMETER RebootRetryCount + The number of times to reboot after failing and then restart retrying. Default value is 0 (zero). +#> function Get-TargetResource { [OutputType([System.Collections.Hashtable])] @@ -63,6 +82,25 @@ function Get-TargetResource } } +<# + .SYNOPSIS + Sets the current state of the specified Active Directory to see if a reboot is required. + + .PARAMETER DomainName + The name of the Active Directory domain to wait for. + + .PARAMETER DomainUserCredential + The user account credentials to use to perform this task. + + .PARAMETER RetryIntervalSec + The interval in seconds between retry attempts. Default value is 60. + + .PARAMETER RetryCount + The number of retries before failing. Default value is 10. + + .PARAMETER RebootRetryCount + The number of times to reboot after failing and then restart retrying. Default value is 0 (zero). +#> function Set-TargetResource { <# @@ -158,6 +196,25 @@ function Set-TargetResource } } +<# + .SYNOPSIS + Tests the current state of the specified Active Directory to see if it is available. + + .PARAMETER DomainName + The name of the Active Directory domain to wait for. + + .PARAMETER DomainUserCredential + The user account credentials to use to perform this task. + + .PARAMETER RetryIntervalSec + The interval in seconds between retry attempts. Default value is 60. + + .PARAMETER RetryCount + The number of retries before failing. Default value is 10. + + .PARAMETER RebootRetryCount + The number of times to reboot after failing and then restart retrying. Default value is 0 (zero). +#> function Test-TargetResource { [OutputType([System.Boolean])] @@ -212,12 +269,22 @@ function Test-TargetResource } } +<# + .SYNOPSIS + Gets the specified Active Directory domain + + .PARAMETER DomainName + The name of the Active Directory domain to wait for. + + .PARAMETER DomainUserCredential + The user account credentials to use to perform this task. +#> function Get-Domain { [OutputType([PSObject])] param ( - # The name of the Active Directory domain to wait for. + # The name of the Active Directory domain to get. [Parameter(Mandatory = $true)] [System.String] $DomainName, From 0a08af4d6190a86324df87affea2d971e829ca2b Mon Sep 17 00:00:00 2001 From: Robert Gouge Date: Mon, 15 Jul 2019 08:45:44 -0500 Subject: [PATCH 3/5] Update Changelog.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce8d041b9..9f3ab9b66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,8 @@ - Added unit tests ([issue #324](https://github.com/PowerShell/xActiveDirectory/issues/324)). - Added comment-based help ([issue #337](https://github.com/PowerShell/xActiveDirectory/issues/337)). - Added integration tests ([issue #348](https://github.com/PowerShell/xActiveDirectory/issues/348)). +- Changes to xWaitForADDomain + - Added comment-based help ([issue #341](https://github.com/PowerShell/xActiveDirectory/issues/341)) ## 3.0.0.0 From 75a24ee1b46c196389b1c3b5883f8e7c678c1b45 Mon Sep 17 00:00:00 2001 From: Robert Gouge Date: Mon, 15 Jul 2019 09:21:28 -0500 Subject: [PATCH 4/5] Remove parameter comments inside functions --- .../MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 b/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 index 2df5cdbd6..cebeb588d 100644 --- a/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 +++ b/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 @@ -116,27 +116,22 @@ function Set-TargetResource [CmdletBinding()] param ( - # The name of the Active Directory domain to wait for. [Parameter(Mandatory = $true)] [System.String] $DomainName, - # The user account credentials to use to perform this task. [Parameter()] [System.Management.Automation.PSCredential] $DomainUserCredential, - # The interval in seconds between retry attempts. Default value is 60. [Parameter()] [System.UInt64] $RetryIntervalSec = 60, - # The number of retries before failing. Default value is 10. [Parameter()] [System.UInt32] $RetryCount = 10, - # The number of times to reboot after failing and then restart retrying. Default value is 0 (zero). [Parameter()] [System.UInt32] $RebootRetryCount = 0 @@ -220,27 +215,22 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - # The name of the Active Directory domain to wait for. [Parameter(Mandatory = $true)] [System.String] $DomainName, - # The user account credentials to use to perform this task. [Parameter()] [System.Management.Automation.PSCredential] $DomainUserCredential, - # The interval in seconds between retry attempts. Default value is 60. [Parameter()] [System.UInt64] $RetryIntervalSec = 60, - # The number of retries before failing. Default value is 10. [Parameter()] [System.UInt32] $RetryCount = 10, - # The number of times to reboot after failing and then restart retrying. Default value is 0 (zero). [Parameter()] [System.UInt32] $RebootRetryCount = 0 @@ -284,12 +274,10 @@ function Get-Domain [OutputType([PSObject])] param ( - # The name of the Active Directory domain to get. [Parameter(Mandatory = $true)] [System.String] $DomainName, - # The user account credentials to use to perform this task. [Parameter()] [System.Management.Automation.PSCredential] $DomainUserCredential From 9f872795ed18e526c33980fab694f9c90dbe6a70 Mon Sep 17 00:00:00 2001 From: Robert Gouge Date: Mon, 15 Jul 2019 12:39:37 -0500 Subject: [PATCH 5/5] Remove in function comments for Get-TargetResource. Add line breaks at 80 columns --- .../MSFT_xWaitForADDomain.psm1 | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 b/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 index cebeb588d..9cd34e1f4 100644 --- a/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 +++ b/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 @@ -8,7 +8,8 @@ $script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xWaitForADDomain' <# .SYNOPSIS - Gets the current state of the specified Active Directory to see if it is available. + Gets the current state of the specified Active Directory to see if it + is available. .PARAMETER DomainName The name of the Active Directory domain to wait for. @@ -23,7 +24,8 @@ $script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xWaitForADDomain' The number of retries before failing. Default value is 10. .PARAMETER RebootRetryCount - The number of times to reboot after failing and then restart retrying. Default value is 0 (zero). + The number of times to reboot after failing and then restart retrying. + Default value is 0 (zero). #> function Get-TargetResource { @@ -31,27 +33,22 @@ function Get-TargetResource param ( - # The name of the Active Directory domain to wait for. [Parameter(Mandatory = $true)] [System.String] $DomainName, - # The user account credentials to use to perform this task. [Parameter()] [System.Management.Automation.PSCredential] $DomainUserCredential, - # The interval in seconds between retry attempts. Default value is 60. [Parameter()] [System.UInt64] $RetryIntervalSec = 60, - # The number of retries before failing. Default value is 10. [Parameter()] [System.UInt32] $RetryCount = 10, - # The number of times to reboot after failing and then restart retrying. Default value is 0 (zero). [Parameter()] [System.UInt32] $RebootRetryCount = 0 @@ -84,7 +81,8 @@ function Get-TargetResource <# .SYNOPSIS - Sets the current state of the specified Active Directory to see if a reboot is required. + Sets the current state of the specified Active Directory to see if a + reboot is required. .PARAMETER DomainName The name of the Active Directory domain to wait for. @@ -99,7 +97,8 @@ function Get-TargetResource The number of retries before failing. Default value is 10. .PARAMETER RebootRetryCount - The number of times to reboot after failing and then restart retrying. Default value is 0 (zero). + The number of times to reboot after failing and then restart retrying. + Default value is 0 (zero). #> function Set-TargetResource { @@ -193,7 +192,8 @@ function Set-TargetResource <# .SYNOPSIS - Tests the current state of the specified Active Directory to see if it is available. + Tests the current state of the specified Active Directory to see if it + is available. .PARAMETER DomainName The name of the Active Directory domain to wait for. @@ -208,7 +208,8 @@ function Set-TargetResource The number of retries before failing. Default value is 10. .PARAMETER RebootRetryCount - The number of times to reboot after failing and then restart retrying. Default value is 0 (zero). + The number of times to reboot after failing and then restart retrying. + Default value is 0 (zero). #> function Test-TargetResource {