Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING: WSManListener: Convert to a Class Resource #106

Open
wants to merge 135 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
7073cc4
Update Build files for Classes
Sep 18, 2024
5064845
Tidy up module psd1 and, remove ref to suffix
Sep 18, 2024
c81f4a5
Add prefix
Sep 18, 2024
cc1ac2c
Move Get-DefaultPort out of the DscResource
Sep 18, 2024
cce3026
Add WSManReason
Sep 18, 2024
8d86381
`Get-InvalidOperationRecord` now provided by `DscResource.Test`
Sep 18, 2024
3e7cdc7
Remove Mof WSManListener
Sep 18, 2024
4a6f35c
Add class WSManListener
Sep 18, 2024
12a4697
Move Get-Listener to Private
Sep 18, 2024
a4c3080
Fix Test
Sep 18, 2024
532366e
Update DN to BaseDN
Sep 18, 2024
3b2b455
Update Changelog
Sep 18, 2024
8f02f2c
Add Find-Certificate
Sep 18, 2024
145c478
Do not use modulefast
Sep 18, 2024
b4da7c6
Add WSManReason Tests
Sep 18, 2024
eb9d9f6
Update tests
Sep 18, 2024
6a5e74d
UPdate Find Certificate
Sep 18, 2024
b41d127
Move away from ValidateSet and update Modify
Sep 19, 2024
e3cc85d
Cast enum correctly
Sep 19, 2024
200e3a0
Move back to enum and return empty state as required
Sep 20, 2024
608485b
Fix tests
Sep 20, 2024
dbdd0c3
Refactor tests
Sep 26, 2024
2577163
Fix missing `f`
Sep 26, 2024
a28b4ef
Remove parenthesis
Sep 26, 2024
c1a50ea
Add more tests
Sep 26, 2024
8222cbc
Update modify to separate functions
Sep 27, 2024
9bc57ee
Add new string
Sep 27, 2024
4dfb52a
Update tests
Sep 27, 2024
336625c
Update syntax error
Sep 27, 2024
a9fc793
Remove empty values
Sep 27, 2024
f1f4a07
Use Transport Enum
Oct 24, 2024
968d2c2
Remove build.psd1
Oct 24, 2024
0bcf61a
Remove backtick
Oct 24, 2024
54aa751
Use Enum in compare
Oct 24, 2024
0bb5766
Remove unused localized data
Oct 24, 2024
8a248ae
Revert to previous logic
Oct 24, 2024
828e05f
Use correct DocGenerator Key
Oct 24, 2024
25fbebb
Use SubjectFormatEnum
Oct 24, 2024
8400119
Set subjectFormat back to previous default
Oct 24, 2024
11956cb
Match Mof resource defaults
Oct 24, 2024
a45970c
Update formatting
Nov 12, 2024
2566d06
Update string as port is not available
Nov 12, 2024
375f723
Update resource from testing
Nov 12, 2024
04aeeec
Update BeforeDiscovery stream redirection
dan-hughes Nov 17, 2024
d8c1396
Add assert properties tests
dan-hughes Nov 17, 2024
807bdc9
Remove Export-ModuleMember
dan-hughes Nov 17, 2024
6157ba1
Update changelog
dan-hughes Nov 17, 2024
5baa147
Fix newlines and add strictmode
dan-hughes Nov 17, 2024
514c668
Use correct error code prefix
Dec 9, 2024
a6c859a
Use Get-ComputerName from DscResource.Common
dan-hughes Jan 12, 2025
12a06d6
Add SubjectFormat and MatchAlternate to bound parameter checks
dan-hughes Jan 12, 2025
0aadf22
Expand AssertProperties tests
dan-hughes Jan 17, 2025
ae0ee81
Remove remaning $ENV:computerName
dan-hughes Jan 17, 2025
5545a3c
Make SubjectFormat nullable to correct bound parameter checks
dan-hughes Jan 17, 2025
3b8588e
Cannot use nullable enums
dan-hughes Jan 17, 2025
423ba17
Enum use starting value of 1
dan-hughes Jan 17, 2025
f406a91
Correct casing
dan-hughes Jan 17, 2025
375fb4d
Remove subjectformat temporarily
dan-hughes Jan 17, 2025
94c053e
Update unit tests for subjectformat using enum
dan-hughes Jan 17, 2025
61b8e27
Disable subjectformat tests
dan-hughes Jan 17, 2025
ebf394e
Add boundparameter filter for enum default values e.g. 0
dan-hughes Jan 17, 2025
452d100
Revert "Remove remaning $ENV:computerName"
dan-hughes Jan 20, 2025
478a2c5
Revert "Use Get-ComputerName from DscResource.Common"
dan-hughes Jan 20, 2025
dcf799a
GetHostByName is deprecated, use Get-ComuterName instead of $env:COMP…
dan-hughes Jan 20, 2025
e6922a9
Update Build files for Classes
Sep 18, 2024
259cca2
Tidy up module psd1 and, remove ref to suffix
Sep 18, 2024
f15b94f
Add prefix
Sep 18, 2024
376d239
Move Get-DefaultPort out of the DscResource
Sep 18, 2024
c453b38
Add WSManReason
Sep 18, 2024
388e631
`Get-InvalidOperationRecord` now provided by `DscResource.Test`
Sep 18, 2024
5ca1705
Remove Mof WSManListener
Sep 18, 2024
ffeee6a
Add class WSManListener
Sep 18, 2024
5862f26
Move Get-Listener to Private
Sep 18, 2024
d4f8ba1
Fix Test
Sep 18, 2024
e7eb8d9
Update DN to BaseDN
Sep 18, 2024
b10f76a
Update Changelog
Sep 18, 2024
0dd676d
Add Find-Certificate
Sep 18, 2024
87b9fdb
Do not use modulefast
Sep 18, 2024
2e6032b
Add WSManReason Tests
Sep 18, 2024
6d8b434
Update tests
Sep 18, 2024
9bb0f43
UPdate Find Certificate
Sep 18, 2024
3949bf2
Move away from ValidateSet and update Modify
Sep 19, 2024
a61251e
Cast enum correctly
Sep 19, 2024
4a8db6e
Move back to enum and return empty state as required
Sep 20, 2024
f316f45
Fix tests
Sep 20, 2024
3cd8a72
Refactor tests
Sep 26, 2024
2911de4
Fix missing `f`
Sep 26, 2024
1c31e94
Remove parenthesis
Sep 26, 2024
9563056
Add more tests
Sep 26, 2024
a8c067b
Update modify to separate functions
Sep 27, 2024
ce21fbe
Add new string
Sep 27, 2024
8c753b6
Update tests
Sep 27, 2024
2cd02e2
Update syntax error
Sep 27, 2024
e1dfbb2
Remove empty values
Sep 27, 2024
8f2a0dc
Use Transport Enum
Oct 24, 2024
c51495d
Remove build.psd1
Oct 24, 2024
6b6d5b0
Remove backtick
Oct 24, 2024
3f673c5
Use Enum in compare
Oct 24, 2024
30c7a02
Remove unused localized data
Oct 24, 2024
6d3c4e9
Revert to previous logic
Oct 24, 2024
ee0741b
Use correct DocGenerator Key
Oct 24, 2024
ea71a89
Use SubjectFormatEnum
Oct 24, 2024
b230808
Set subjectFormat back to previous default
Oct 24, 2024
b1b9ecb
Match Mof resource defaults
Oct 24, 2024
c7feeb5
Update formatting
Nov 12, 2024
a7950d4
Update string as port is not available
Nov 12, 2024
6ab891c
Update resource from testing
Nov 12, 2024
7428d81
Update BeforeDiscovery stream redirection
dan-hughes Nov 17, 2024
5c86af9
Add assert properties tests
dan-hughes Nov 17, 2024
946daf1
Remove Export-ModuleMember
dan-hughes Nov 17, 2024
11c9019
Update changelog
dan-hughes Nov 17, 2024
fb08dd8
Fix newlines and add strictmode
dan-hughes Nov 17, 2024
f4cb0b3
Use correct error code prefix
Dec 9, 2024
1ec4a55
Use Get-ComputerName from DscResource.Common
dan-hughes Jan 12, 2025
b55001d
Add SubjectFormat and MatchAlternate to bound parameter checks
dan-hughes Jan 12, 2025
d1543fe
Expand AssertProperties tests
dan-hughes Jan 17, 2025
d32a551
Remove remaning $ENV:computerName
dan-hughes Jan 17, 2025
34b71da
Make SubjectFormat nullable to correct bound parameter checks
dan-hughes Jan 17, 2025
a6fa777
Cannot use nullable enums
dan-hughes Jan 17, 2025
725e05e
Enum use starting value of 1
dan-hughes Jan 17, 2025
d9c87a4
Correct casing
dan-hughes Jan 17, 2025
9747472
Remove subjectformat temporarily
dan-hughes Jan 17, 2025
28776f5
Update unit tests for subjectformat using enum
dan-hughes Jan 17, 2025
c0960b4
Disable subjectformat tests
dan-hughes Jan 17, 2025
cdacf22
Add boundparameter filter for enum default values e.g. 0
dan-hughes Jan 17, 2025
4ae14ea
Revert "Remove remaning $ENV:computerName"
dan-hughes Jan 20, 2025
48e8b3b
Revert "Use Get-ComputerName from DscResource.Common"
dan-hughes Jan 20, 2025
dc26b6b
GetHostByName is deprecated, use Get-ComuterName instead of $env:COMP…
dan-hughes Jan 20, 2025
e71fbb7
Merge branch 'feat/wsman-listener-class' of https://github.com/dan-hu…
dan-hughes Jan 28, 2025
e6a7bec
Enable optional enum feature in base class
dan-hughes Feb 2, 2025
3a1f6a0
Fix changelog
dan-hughes Feb 2, 2025
36e0eca
Remove CommonTestHelper as function now in DscResource.Test
dan-hughes Feb 2, 2025
efca431
Update changelog
dan-hughes Feb 2, 2025
3d7e440
Use preview doc generator for class updates
dan-hughes Feb 3, 2025
58171a0
Move setting Port and Address out of GetCurrentState
dan-hughes Feb 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- `WSManReason`
- Used in Class Resources
- `WSManSubjectFormat` Enum
- `WSManTransport` Enum
- `RequiredModules`
- Added `DscResource.Base` class.

### Changed

- `DSC_WSManListener`
- Converted to Class Resource.
- Extracted private functions to individual files.
- BREAKING: Renamed parameter `DN` to `BaseDN` - fixes [Issue #89](https://github.com/dsccommunity/WSManDsc/issues/89).
- `DSC_WSManConfig`
- Removed Export-ModuleMember.
- `DSC_WSManServiceConfig`
- Removed Export-ModuleMember.

### Removed

- `CommonTestHelper`
- This is now provided by `DscResource.Test`

## [3.2.0] - 2025-01-19

### Added
Expand Down
10 changes: 8 additions & 2 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@{
PSDependOptions = @{
PSDependOptions = @{
AddToPath = $true
Target = 'output\RequiredModules'
Parameters = @{
Expand All @@ -21,12 +21,18 @@

# Build dependencies needed for using the module
'DscResource.Common' = 'latest'
'DscResource.Base' = 'latest'

# Analyzer rules
'DscResource.AnalyzerRules' = 'latest'
'Indented.ScriptAnalyzerRules' = 'latest'

# Prerequisite modules for documentation.
'DscResource.DocGenerator' = 'latest'
'DscResource.DocGenerator' = @{
Version = 'latest'
Parameters = @{
AllowPrerelease = $true
}
}
PlatyPS = 'latest'
}
11 changes: 6 additions & 5 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ CopyPaths:
- en-US
- DSCResources
Prefix: prefix.ps1
Suffix: suffix.ps1
Encoding: UTF8
VersionedOutputDirectory: true
BuiltModuleSubdirectory: builtModule
Expand Down Expand Up @@ -80,11 +79,15 @@ NestedModule:
Path: ./output/RequiredModules/DscResource.Common
AddToManifest: false
Exclude: PSGetModuleInfo.xml
DscResource.Base:
CopyOnly: true
Path: ./output/RequiredModules/DscResource.Base
AddToManifest: false
Exclude: PSGetModuleInfo.xml

####################################################
# Pester Configuration (Sampler) #
####################################################

Pester:
Configuration:
Run:
Expand All @@ -105,8 +108,6 @@ Pester:
ExcludeFromCodeCoverage:
- Modules/DscResource.Common
- Modules/DscResource.Base
- prefix.ps1
- WSManDsc.psm1

####################################################
# Pester Configuration (DscResource.Test) #
Expand Down Expand Up @@ -169,7 +170,7 @@ DscResource.DocGenerator:
- '\*(.+?)\*' # Match Italic (asterisk)
Publish_GitHub_Wiki_Content:
Debug: false
Generate_Wiki_Content:
Generate_Markdown_For_DSC_Resources:
MofResourceMetadata:
Type: MofResource
Category: Resources
Expand Down
5 changes: 0 additions & 5 deletions source/Build.psd1

This file was deleted.

21 changes: 21 additions & 0 deletions source/Classes/001.WSManReason.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<#
.SYNOPSIS
The reason a property of a DSC resource is not in desired state.

.DESCRIPTION
A DSC resource can have a read-only property `Reasons` that the compliance
part (audit via Azure Policy) of Azure AutoManage Machine Configuration
uses. The property Reasons holds an array of WSManReason. Each WSManReason
explains why a property of a DSC resource is not in desired state.
#>

class WSManReason
{
[DscProperty()]
[System.String]
$Code

[DscProperty()]
[System.String]
$Phrase
}
Loading
Loading