Skip to content
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added `DscResource.Base` class.
- `WSManConfigBase`
- Base class for WSMan*Config Resources fixes [#44](https://github.com/dsccommunity/WSManDsc/issues/44).
- `WSManClientConfig` resource. Fixes [#41](https://github.com/dsccommunity/WSManDsc/issues/41).
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Wrap the new changelog entry to 80 chars.

Line 18 exceeds the 80-character guideline; wrap the link to the next line with a 2‑space indent.

💡 Suggested wrap
- - `WSManClientConfig` resource. Fixes [`#41`](https://github.com/dsccommunity/WSManDsc/issues/41).
+ - `WSManClientConfig` resource. Fixes
+   [`#41`](https://github.com/dsccommunity/WSManDsc/issues/41).
As per coding guidelines, wrap Markdown lines over 80 characters.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- `WSManClientConfig` resource. Fixes [#41](https://github.com/dsccommunity/WSManDsc/issues/41).
- `WSManClientConfig` resource. Fixes
[`#41`](https://github.com/dsccommunity/WSManDsc/issues/41).
🤖 Prompt for AI Agents
In `@CHANGELOG.md` at line 18, The CHANGELOG.md entry containing
"`WSManClientConfig` resource. Fixes
[`#41`](https://github.com/dsccommunity/WSManDsc/issues/41)." is longer than 80
characters; update the line by wrapping the issue link onto the next line so the
first line stays ≤80 chars and indent the continued line with two spaces
(preserve the text exactly, just break after the sentence and place the link on
the next line with a two-space indent).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

80 chars is an old limit, I believe it's something like 120 chars.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dan-hughes, according to the coding guidelines for this repository, there are different line length limits for different file types:

  • Markdown files (**/*.md): Wrap lines at word boundaries when over 80 characters (except tables/code blocks)
  • PowerShell files (**/*.{ps1,psm1,psd1}): Limit lines to 120 characters

Since CHANGELOG.md is a Markdown file, the 80-character limit applies per the guidelines. The 120-character limit you're thinking of is specifically for PowerShell code files.

That said, if you prefer to keep the current formatting, that's your call as the maintainer! I'm just following the repository's documented guidelines.


🧠 Learnings used
Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 2343
File: source/Classes/004.DatabaseFileGroupSpec.ps1:5-34
Timestamp: 2025-11-22T17:36:09.703Z
Learning: The comment-based help requirements for ## Requirements and ## Known issues sections only apply to class-based DSC resources (classes decorated with [DscResource(...)]) in source/Classes/**/*.ps1, not to regular helper classes, DTO classes, or specification classes in the same directory.

Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-class-resource.instructions.md:0-0
Timestamp: 2025-11-27T17:58:20.404Z
Learning: Applies to source/[cC]lasses/**/*.ps1 : DSC class-based resources must inherit from `ResourceBase` class from the DscResource.Base module

Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-class-resource.instructions.md:0-0
Timestamp: 2025-11-27T17:58:20.404Z
Learning: Applies to source/[cC]lasses/**/*.ps1 : DSC class-based resources must include comment-based help with .DESCRIPTION section containing Requirements and Known issues sections with a link to all open issues on GitHub

Learnt from: Borgquite
Repo: dsccommunity/UpdateServicesDsc PR: 78
File: source/DSCResources/MSFT_UpdateServicesComputerTargetGroup/MSFT_UpdateServicesComputerTargetGroup.psm1:9-22
Timestamp: 2025-10-03T15:27:24.417Z
Learning: In the UpdateServicesDsc repository, MOF-based DSC resources follow a minimal comment-based help convention that includes only .SYNOPSIS and .PARAMETER sections. The .DESCRIPTION, .INPUTS, and .OUTPUTS sections are intentionally omitted, even though functions have [OutputType()] attributes. This is consistent across all existing DSC resources: MSFT_UpdateServicesServer, MSFT_UpdateServicesCleanup, and MSFT_UpdateServicesApprovalRule.

Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-class-resource.instructions.md:0-0
Timestamp: 2025-11-27T17:58:20.404Z
Learning: Applies to source/[cC]lasses/020.*.ps1 : DSC class-based resources must use the file naming pattern `source/Classes/020.{ResourceName}.ps1`

Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-class-resource.instructions.md:0-0
Timestamp: 2025-11-27T17:58:20.404Z
Learning: Applies to source/[cC]lasses/**/*.ps1 : DSC class-based resources must implement a required constructor with signature `ResourceName () : base ($PSScriptRoot)` and populate `$this.ExcludeDscProperties` array

Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-powershell.instructions.md:0-0
Timestamp: 2025-12-24T18:09:36.332Z
Learning: Applies to **/*.{ps1,psm1,psd1} : Limit lines to 120 characters


### Changed

Expand Down
2 changes: 1 addition & 1 deletion Resolve-Dependency.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
AllowPrerelease = $false
WithYAML = $true

#UseModuleFast = $true
UseModuleFast = $true
#ModuleFastVersion = '0.1.2'
#ModuleFastBleedingEdge = $true

Expand Down
17 changes: 14 additions & 3 deletions source/Classes/010.WSManConfigBase.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ class WSManConfigBase : ResourceBase
continue
}

if ($targetType -eq [System.String[]])
{
$state[$property.Name] = $property.Value -split ','
continue
}

$state[$property.Name] = [System.Management.Automation.LanguagePrimitives]::ConvertTo(
$property.Value,
$targetType
Expand All @@ -89,14 +95,19 @@ class WSManConfigBase : ResourceBase

foreach ($property in $properties.GetEnumerator())
{
$uri = $baseUri
if ($property.Name.StartsWith('Auth'))
{
$property.Name = $property.Name -replace '^Auth', ''
Set-Item -Path ('{0}\Auth\{1}' -f $baseUri, $property.Name) -Value $property.Value -Force
continue
$uri = ('{0}\Auth' -f $baseUri)
}

if ($property.Value -is [System.String[]])
{
$property.Value = $property.Value -join ','
}

Set-Item -Path ('{0}\{1}' -f $baseUri, $property.Name) -Value $property.Value -Force
Set-Item -Path ('{0}\{1}' -f $uri, $property.Name) -Value $property.Value -Force
}
}

Expand Down
131 changes: 131 additions & 0 deletions source/Classes/020.WSManClientConfig.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<#
.SYNOPSIS
The `WSManClientConfig` DSC resource is used to configure WS-Man client specific settings.

.DESCRIPTION
This resource is used configure WS-Man Client settings.

Comment thread
dan-hughes marked this conversation as resolved.
.PARAMETER NetworkDelayms
Specifies the extra time in milliseconds that the client computer waits to accommodate for network delay time.

.PARAMETER URLPrefix
Specifies a URL prefix on which to accept HTTP or HTTPS requests. The default URL prefix is wsman.

.PARAMETER AllowUnencrypted
Allows the client computer to request unencrypted traffic.

.PARAMETER TrustedHosts
Specifies the list of remote computers that are trusted.

.PARAMETER AuthBasic
Allows the WinRM client to use Basic authentication.

.PARAMETER AuthDigest
Allows the WinRM client to use Digest authentication.

.PARAMETER AuthCertificate
Allows the WinRM client to use client certificate-based authentication.

.PARAMETER AuthKerberos
Allows the WinRM client to use Kerberos authentication.

.PARAMETER AuthNegotiate
Allows the WinRM client to use Negotiate authentication.

.PARAMETER AuthCredSSP
Allows the WinRM client to use Credential Security Support Provider (CredSSP) authentication.
#>

[DscResource()]
class WSManClientConfig : WSManConfigBase
{
[DscProperty()]
[Nullable[System.UInt32]]
$NetworkDelayms

[DscProperty()]
[System.String]
$URLPrefix

[DscProperty()]
[Nullable[System.Boolean]]
$AllowUnencrypted

[DscProperty()]
[System.String[]]
$TrustedHosts

[DscProperty()]
[Nullable[System.Boolean]]
$AuthBasic

[DscProperty()]
[Nullable[System.Boolean]]
$AuthDigest

[DscProperty()]
[Nullable[System.Boolean]]
$AuthCertificate

[DscProperty()]
[Nullable[System.Boolean]]
$AuthKerberos

[DscProperty()]
[Nullable[System.Boolean]]
$AuthNegotiate

[DscProperty()]
[Nullable[System.Boolean]]
$AuthCredSSP

WSManClientConfig () : base ()
{
$this.ResourceURI = 'localhost\Client'
$this.HasAuthContainer = $true
}
Comment thread
dan-hughes marked this conversation as resolved.

[WSManClientConfig] Get()
{
# Call the base method to return the properties.
return ([ResourceBase] $this).Get()
}

[void] Set()
{
# Call the base method to enforce the properties.
([ResourceBase] $this).Set()
}

[System.Boolean] Test()
{
# Call the base method to test all of the properties that should be enforced.
return ([ResourceBase] $this).Test()
}

<#
Base method Assert() call this method with the properties that was assigned
a value.
#>
hidden [void] AssertProperties([System.Collections.Hashtable] $properties)
{
$assertBoundParameterParameters = @{
BoundParameterList = $properties
RequiredParameter = @(
'NetworkDelayms'
'URLPrefix'
'AllowUnencrypted'
'TrustedHosts'
'AuthBasic'
'AuthDigest'
'AuthCertificate'
'AuthKerberos'
'AuthNegotiate'
'AuthCredSSP'
)
RequiredBehavior = 'Any'
}

Assert-BoundParameter @assertBoundParameterParameters
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<#PSScriptInfo
.VERSION 1.0.0
.GUID 5eb95759-9a02-4121-bfca-bba124bfc4f8
.AUTHOR DSC Community
.COMPANYNAME DSC Community
.COPYRIGHT Copyright the DSC Community contributors. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/dsccommunity/WSManDsc/blob/main/LICENSE
.PROJECTURI https://github.com/dsccommunity/WSManDsc
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES First version.
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
#>

#Requires -module WSManDsc

<#
.DESCRIPTION
Set the WS-Man client to disallow unencrypted traffic,
disable Basic authentication and set TrustedHosts to '*'.
#>
Comment thread
dan-hughes marked this conversation as resolved.
Configuration WSManClientConfig_Config
{
Import-DscResource -Module WSManDsc

Node localhost
{
WSManClientConfig ClientConfig
{
IsSingleInstance = 'Yes'
AllowUnencrypted = $false
AuthBasic = $false
TrustedHosts = '*'

} # End of WSManClientConfig Resource
} # End of Node
} # End of Configuration
14 changes: 14 additions & 0 deletions source/en-US/WSManClientConfig.strings.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<#
.SYNOPSIS
The localized resource strings in English (en-US) for the
resource WSManClientConfig. This file should only contain
localized strings for private functions, public command, and
classes (that are not a DSC resource).
#>

ConvertFrom-StringData @'
## Strings overrides for the ResourceBase's default strings.
# None

## Strings directly used by the derived class WSManClientConfig.
'@
2 changes: 1 addition & 1 deletion source/en-US/WSManConfig.strings.psd1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<#
.SYNOPSIS
The localized resource strings in English (en-US) for the
resource WSManConfig module. This file should only contain
resource WSManConfig. This file should only contain
localized strings for private functions, public command, and
classes (that are not a DSC resource).
#>
Expand Down
2 changes: 1 addition & 1 deletion source/en-US/WSManListener.strings.psd1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<#
.SYNOPSIS
The localized resource strings in English (en-US) for the
resource WSManListener module. This file should only contain
resource WSManListener. This file should only contain
localized strings for private functions, public command, and
classes (that are not a DSC resource).
#>
Expand Down
2 changes: 1 addition & 1 deletion source/en-US/WSManServiceConfig.strings.psd1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<#
.SYNOPSIS
The localized resource strings in English (en-US) for the
resource WSManServiceConfig module. This file should only contain
resource WSManServiceConfig. This file should only contain
localized strings for private functions, public command, and
classes (that are not a DSC resource).
#>
Expand Down
Loading