Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
e9bd332
Add ResourceLogCategory class and unit tests
fslef Mar 27, 2024
e7b6443
Bump gittools/actions from 0.9.15 to 1.1.1 (#5)
dependabot[bot] Mar 27, 2024
819a764
Bump actions/download-artifact from 3 to 4 (#7)
dependabot[bot] Mar 27, 2024
2cca178
Bump actions/upload-artifact from 3 to 4 (#6)
dependabot[bot] Mar 27, 2024
2e67f97
Bump actions/checkout from 3 to 4 (#4)
dependabot[bot] Mar 27, 2024
73b527d
Bump codecov/codecov-action from 4.0.1 to 4.1.1 (#3)
dependabot[bot] Mar 27, 2024
3e4fb14
Refactor ResourceType to ResourceLogCategory
fslef Mar 27, 2024
5bed922
Add unit test for ResourceLogCategory class
fslef Mar 27, 2024
5d8368a
Add 'ResourceLogCategory' Class
fslef Mar 28, 2024
9ef102a
Add 'ResourceLogCategory' Class
fslef Mar 28, 2024
6f8174a
Remove ResourceLogCategory test file
fslef Mar 28, 2024
c922479
Add 'ResourceLogCategory' Class
fslef Mar 28, 2024
f226a22
Refactor ResourceLogCategory class constructors and add unit tests
fslef Mar 28, 2024
ac4b696
Add unit test template for <ClassName> class
fslef Mar 28, 2024
522b0dd
Refactor ResourceLogCategory.tests.ps1
fslef Mar 28, 2024
e35ddd3
Update CodeCoverageThreshold to 60%
fslef Mar 28, 2024
46e2a67
Addes Az.Monitor in RequiredModules
fslef Mar 28, 2024
32a797d
Added Az.Accounts and Az.Resources as required modules
fslef Mar 28, 2024
6635fbf
Mock Get-AzResource function to return predefined results for testing
fslef Mar 28, 2024
e291a5b
Add parameter filter to ResourceLogCategory.tests.ps1
fslef Mar 28, 2024
d8ea625
Refactor ResourceLogCategory.tests.ps1 file
fslef Mar 28, 2024
153f63d
Remove unnecessary parameter filter in ResourceLogCategory.tests.ps1
fslef Mar 28, 2024
f19d47f
Refactored Get-AzResource mock in ResourceLogCategory.tests.ps1
fslef Mar 28, 2024
948bfe5
Mock Get-AzDiagnosticSettingCategory command in ResourceLogCategory.t…
fslef Mar 28, 2024
a853e44
Refactor ResourceLogCategory.tests.ps1 to use 'CyberShell' module
fslef Mar 28, 2024
1bc49cc
Add -Verifiable flag to Get-AzResource calls in ResourceLogCategory.t…
fslef Mar 28, 2024
eabe8dd
Refactor ResourceLogCategory.tests.ps1 to remove unnecessary module n…
fslef Mar 28, 2024
f27cc3e
Remove unnecessary parameter in ResourceLogCategory.tests.ps1
fslef Mar 28, 2024
373ff87
Add unit tests for ResourceLogCategory class
fslef Mar 28, 2024
7706a89
Refactor ResourceLogCategory.tests.ps1
fslef Mar 28, 2024
65f3cd8
Add mock for Get-AzContext command
fslef Mar 28, 2024
d34a0b7
Fix module import in ResourceLogCategory.tests.ps1
fslef Mar 28, 2024
b4f7b2f
Remove unnecessary parameters in mock functions
fslef Mar 28, 2024
7658a02
Remove parameter validation in ResourceLogCategory.tests.ps1
fslef Mar 28, 2024
9eb9266
Remove unnecessary modules from RequiredModules.psd1
fslef Mar 28, 2024
dd56b1e
Remove parameter validation in ResourceLogCategory.tests.ps1
fslef Mar 28, 2024
e0a0b2e
Update CodeCoverageThreshold in build.yaml
fslef Mar 28, 2024
44d8678
Add Connect-AzAccount to ResourceLogCategory.tests.ps1
fslef Mar 29, 2024
fb982b5
Add latest Az modules
fslef Mar 29, 2024
bc876ea
Add simulated Azure context for testing
fslef Mar 29, 2024
8bb827d
Add UnitQuality tag to <ClassName> Class Unit Tests
fslef Mar 29, 2024
ddeae63
Refactor unit tests for ResourceLogCategory class
fslef Mar 29, 2024
e2bbb15
Add UnitQuality to Pester exclusion in build.yaml
fslef Mar 29, 2024
6bfaae0
Refactor azureProfile object creation
fslef Mar 29, 2024
0048d1c
Remove unit test template file
fslef Apr 2, 2024
1221148
Fix tags in module.tests.ps1
fslef Apr 2, 2024
f0231ec
Delete ResourceLogCategory class
fslef Apr 2, 2024
0bfc643
Refactor ListOfLogCategory class for better resource management
fslef Apr 8, 2024
35f2b4b
Add LogCategoryObj class for managing log categories
fslef Apr 8, 2024
a4be02c
Add Get-CsLogCategory function for retrieving Azure resources and the…
fslef Apr 8, 2024
1df4f64
Merge main into feat/Get-ResourceLogCategory
fslef Dec 17, 2025
ec87117
Fix tag formatting in module tests and resolve merge conflicts
fslef Dec 17, 2025
83d0bc4
Normalize spacing in RequiredModules.psd1 for consistency
fslef Dec 17, 2025
81e47bc
Enable prerelease modules and update dependency versions in Resolve-D…
fslef Dec 18, 2025
d44ce22
Fix YAML syntax error - remove merge conflict markers from build.yaml
fslef Dec 18, 2025
44627ec
Add commit-message-incrementing setting to GitVersion.yml
fslef Dec 18, 2025
d7c5adc
Add prompt for updating PowerShell function comment-based help docume…
fslef Dec 18, 2025
7ad566a
Refactore synopsys block
fslef Dec 18, 2025
4a6ab01
Enable publishing module to gallery in build workflow
fslef Dec 18, 2025
87d1abd
Enhance task definitions in tasks.json for automated testing and Pest…
fslef Dec 22, 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
166 changes: 166 additions & 0 deletions .github/prompts/update-synopsys.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
---
description: "Review and update PowerShell function comment-based help to ensure complete and accurate documentation"
agent: "agent"
model: "GPT-5.2"
---

# Update PowerShell Function Synopsis

Review and update the comment-based help block for all PowerShell functions in this repository. Ensure that every file in scope (all public and private function scripts) is processed until completion. For each function, the comment-based help block (synopsis block) must be placed immediately after the function name and before the param block, inside the function definition, to comply with project conventions. All other requirements below must also be met. Do not stop until every file is compliant.

## Formatting and Style

- Use consistent indentation (4 spaces) for all content under each help tag (e.g., .SYNOPSIS, .DESCRIPTION, .PARAMETER, etc.).
- Place a blank line between each major help tag (e.g., between .SYNOPSIS and .DESCRIPTION, between .DESCRIPTION and .PARAMETER, etc.).
- For .PARAMETER and .EXAMPLE sections, keep the content readable and aligned, following the style of existing well-formatted help blocks in the codebase.
- Do not compress help blocks into a single paragraph; preserve logical line breaks and paragraph structure for clarity.
- Use the original style as seen in existing compliant files (such as Get-DSFileInventory.ps1) as the standard for all future help blocks.

## Requirements

All public PowerShell functions must have complete comment-based help that includes.prompts for the following sections:

### 1. .SYNOPSIS

- Must be present
- Should be a brief, one-line description of what the function does
- Keep it concise (typically under 100 characters)
- Use active voice and start with a verb

### 2. .DESCRIPTION

- Must be present
- Must be longer than 40 characters
- Should provide detailed explanation of the function's purpose and behavior
- Explain what the function does, not how it does it
- Include any important context or prerequisites

### 3. .EXAMPLE

- Must have at least one example
- Should demonstrate the most common use case first
- Include example output or results when helpful
- Add multiple examples for complex functions showing different scenarios
- Each example should have a description explaining what it does

### 4. .PARAMETER

- Must describe all parameters
- Each parameter description should explain:
- What the parameter does
- Valid values or format expected
- Whether it accepts pipeline input
- Any default values if applicable

## Example Format

```powershell
<#
.SYNOPSIS
Gets the sanitization configuration for the current session.

.DESCRIPTION
The Get-DSConfig function retrieves the current DataSanitizer configuration
settings that control how data detection and sanitization operations are performed.
This includes detection rules, file paths, and processing options.

.PARAMETER Path
The path to the configuration file. If not specified, uses the default
configuration location in the module directory.

.PARAMETER Detailed
Returns additional configuration metadata including load time and source file.

.EXAMPLE
Get-DSConfig

Retrieves the current configuration using default settings.

.EXAMPLE
Get-DSConfig -Path "C:\Custom\config.json"

Loads configuration from a custom location.

.EXAMPLE
Get-DSConfig -Detailed

Returns the configuration with additional metadata about when and where
it was loaded from.

.OUTPUTS
PSCustomObject
Returns a custom object containing the configuration settings.

.NOTES
This function is typically called automatically during module initialization.
#>
```

## Validation Checklist

Before completing the update, verify:

- [ ] `.SYNOPSIS` exists and is concise
- [ ] `.DESCRIPTION` exists and is longer than 40 characters
- [ ] At least one `.EXAMPLE` is provided
- [ ] All function parameters have `.PARAMETER` descriptions
- [ ] Examples show realistic usage scenarios
- [ ] Parameter descriptions explain purpose and expected values
- [ ] Help text follows PowerShell conventions

## Accuracy Review

**CRITICAL**: Verify that existing help documentation matches the current code implementation:

- [ ] **Parameter list matches**: All parameters in the function signature have `.PARAMETER` entries
- [ ] **No orphaned parameters**: Remove `.PARAMETER` entries for parameters that no longer exist
- [ ] **Parameter types accurate**: Verify type declarations match the actual parameter types
- [ ] **Default values current**: Update any mentioned default values to match code
- [ ] **Mandatory status correct**: Document which parameters are mandatory vs optional
- [ ] **Pipeline support accurate**: Verify `ValueFromPipeline` and `ValueFromPipelineByPropertyName` claims
- [ ] **Return type matches**: `.OUTPUTS` section reflects what the function actually returns
- [ ] **Examples work**: Test each example to ensure it runs without errors
- [ ] **Behavior described correctly**: `.DESCRIPTION` accurately reflects current function logic
- [ ] **WhatIf/Confirm support**: Document if function supports `-WhatIf` and `-Confirm`

### Common Issues to Check

1. **Parameters added/removed**: Code may have been refactored without updating help
2. **Parameter renamed**: Old parameter names in examples or descriptions
3. **Changed default values**: Help mentions old defaults
4. **Modified behavior**: Description doesn't match current implementation
5. **Broken examples**: Examples use outdated syntax or removed features
6. **Missing new features**: Recent functionality not documented
7. **Incorrect pipeline behavior**: Help claims don't match actual implementation

## Additional Best Practices

- Use `.OUTPUTS` to document the type of object returned
- Ensure help text is grammatically correct and professional
- Test help display with `Get-Help <FunctionName> -Full`

## Files to Review

Review **all** functions in both public and private directories:

- `source/Public/**/*.ps1` - Exported functions used by module consumers (critical)
- `source/Private/**/*.ps1` - Internal functions used within the module

### Documentation Priority

**Public Functions** (highest priority):

- Complete, detailed documentation is critical
- These are exported and used by external consumers
- Examples must be comprehensive and realistic
- All parameters must be thoroughly documented

**Private Functions** (still important):

- Complete documentation helps maintainability
- Assists other developers working on the module
- May be less detailed than public functions but still required
- Examples can focus on internal use cases
- Helps with code understanding and refactoring

Both public and private functions must meet all requirements, but public functions should have more comprehensive examples and descriptions since they form the module's public API.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ node_modules
package-lock.json

**/*nosync*/**

.automatedlab/
49 changes: 47 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,53 @@
{
"label": "test",
"type": "shell",
"command": "&${cwd}/.automatedlab/automatedlab.ps1",
"args": [],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "dedicated",
"showReuseMessage": true,
"clear": false
},
"problemMatcher": [
{
"owner": "powershell",
"fileLocation": [
"absolute"
],
"severity": "error",
"pattern": [
{
"regexp": "^\\s*(\\[-\\]\\s*.*?)(\\d+)ms\\s*$",
"message": 1
},
{
"regexp": "(.*)",
"code": 1
},
{
"regexp": ""
},
{
"regexp": "^.*,\\s*(.*):\\s*line\\s*(\\d+).*",
"file": 1,
"line": 2
}
]
}
]
},
{
"label": "pester",
"type": "shell",
"command": "&${cwd}/build.ps1",
"args": ["-AutoRestore","-Tasks","test"],
"args": [
"-AutoRestore",
"-Tasks",
"test"
],
"presentation": {
"echo": true,
"reveal": "always",
Expand Down Expand Up @@ -122,4 +167,4 @@
]
}
]
}
}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Powershell module initialization using the excellent [Sampler](https://github.com/gaelcolas/Sampler).
- Add 'ResourceLogCategory' Class
- `Import-CsEnvironment`: Import settings and environments from JSON/JSONC files to configure PowerShell environments easily.
- `Write-OutputPadded`: Enhance output readability by formatting it with customizable padding and styling options.
- `Set-CsConfig`: Create or update configuration files to adjust PowerShell environment settings as needed.
Expand Down
1 change: 1 addition & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ minor-version-bump-message: '(adds?|features?|minor)\b'
patch-version-bump-message: '\s?(fix|patch)'
no-bump-message: '\+semver:\s?(none|skip)'
assembly-informational-format: "{NuGetVersionV2}+Sha.{Sha}.Date.{CommitDate}"
commit-message-incrementing: MergeMessageOnly
branches:
main:
tag: preview
Expand Down
21 changes: 12 additions & 9 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@
# }
#}

InvokeBuild = 'latest'
PSScriptAnalyzer = 'latest'
Pester = 'latest'
ModuleBuilder = 'latest'
ChangelogManagement = 'latest'
Sampler = 'latest'
'Sampler.GitHubTasks' = 'latest'
'DscResource.DocGenerator' = 'latest'
PlatyPS = 'latest'
InvokeBuild = 'latest'
PSScriptAnalyzer = 'latest'
Pester = 'latest'
ModuleBuilder = 'latest'
ChangelogManagement = 'latest'
Sampler = 'latest'
'Sampler.GitHubTasks' = 'latest'
'DscResource.DocGenerator' = 'latest'
PlatyPS = 'latest'
'Az.Accounts' = 'latest'
'Az.Monitor' = 'latest'
'Az.Resources' = 'latest'


}
Expand Down
12 changes: 6 additions & 6 deletions Resolve-Dependency.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#AllowOldPowerShellGetModule = $true
#MinimumPSDependVersion = '0.3.0'
AllowPrerelease = $false
AllowPrerelease = $true
WithYAML = $true # Will also bootstrap PowerShell-Yaml to read other config files

<#
Expand All @@ -57,20 +57,20 @@
script and correct parameter values. This will also affect the use of parameter
`-UseModuleFast` of the Resolve-Dependency.ps1 or build.ps1 script.
#>
#UseModuleFast = $true
#ModuleFastVersion = '0.1.2'
#ModuleFastBleedingEdge = $true
UseModuleFast = $true
ModuleFastVersion = '0.6.0'
ModuleFastBleedingEdge = $true

<#
Enable PSResourceGet to be the default method of resolving dependencies by setting
UsePSResourceGet to the value $true. If UsePSResourceGet is not configured or
set to $false then PowerShellGet will be used to resolve dependencies.
#>
UsePSResourceGet = $true
PSResourceGetVersion = '1.0.1'
PSResourceGetVersion = '1.1.1'

# PowerShellGet compatibility module only works when using PSResourceGet or ModuleFast.
UsePowerShellGetCompatibilityModule = $true
UsePowerShellGetCompatibilityModule = $false
UsePowerShellGetCompatibilityModuleVersion = '3.0.23-beta23'
}

2 changes: 1 addition & 1 deletion build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ BuildWorkflow:

publish:
- Publish_Release_To_GitHub # Runs first, if token is expired it will fail early
# - publish_module_to_gallery
- publish_module_to_gallery

ModuleBuildTasks:
Sampler:
Expand Down
Loading