Skip to content

Commit 9014e14

Browse files
Merge branch 'main' into chore/PR_summary
2 parents 20cbf1e + 0dea9df commit 9014e14

File tree

12 files changed

+62
-44
lines changed

12 files changed

+62
-44
lines changed

.github/actions/ps-resolve-dependencies/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ runs:
1313
run: |
1414
$moduleRequirements = Import-PowerShellDataFile -Path './requirements.psd1'
1515
$moduleList = foreach ($module in $moduleRequirements.GetEnumerator()) {
16+
if ($module.Key -eq 'PSDependOptions') { continue }
1617
$moduleName = $module.Key
1718
$moduleInfo = $module.Value
1819

.github/workflows/bootstrap.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ jobs:
116116
}
117117
[void] (New-ModuleManifest @Params)
118118
119+
- name: Rename prefix file to match module name
120+
run: |
121+
MODULE_NAME=${{ github.event.repository.name }}
122+
git mv src/PSScriptModule.prefix.ps1 "src/$MODULE_NAME.prefix.ps1"
123+
124+
- name: Rename suffix file to match module name
125+
run: |
126+
MODULE_NAME=${{ github.event.repository.name }}
127+
git mv src/PSScriptModule.suffix.ps1 "src/$MODULE_NAME.suffix.ps1"
128+
119129
- name: Update README.md
120130
run: |
121131
OWNER=${{ github.repository_owner }}
@@ -224,4 +234,3 @@ jobs:
224234
}
225235
}
226236
}
227-

.vscode/extensions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"recommendations": [
3-
"GitHub.copilot",
43
"GitHub.copilot-chat",
54
// PowerShell extension for VS Code
65
"ms-vscode.powershell",

.vscode/settings.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"editor.renderWhitespace": "all",
77
"editor.insertSpaces": true,
88
"editor.defaultFormatter": "ms-vscode.powershell",
9-
109
// File settings
1110
"[powershell]": {
1211
"files.trimTrailingWhitespace": true,
@@ -15,11 +14,9 @@
1514
"files.exclude": {
1615
"**/.DS_Store": true
1716
},
18-
1917
// Enable PowerShell Script Analyzer in workspace
2018
"powershell.scriptAnalysis.enable": true,
2119
"powershell.scriptAnalysis.settingsPath": "tests/PSScriptAnalyzer/PSScriptAnalyzerSettings.psd1",
22-
2320
// PowerShell extension settings
2421
"powershell.codeFormatting.autoCorrectAliases": true,
2522
// Sets the codeformatting options to follow the given indent style in a way that is compatible with PowerShell syntax. For more information about the brace styles please refer to https://github.com/PoshCode/PowerShellPracticeAndStyle/issues/81.
@@ -39,8 +36,6 @@
3936
"powershell.codeFormatting.useCorrectCasing": true,
4037
// Enables Pester 5 CodeLens features such as Run Test, Debug Test, and Code Coverage.
4138
"powershell.pester.useLegacyCodeLens": false,
42-
43-
4439
// Markdown lint settings
4540
// https://github.com/PowerShell/PowerShell/blob/master/.markdownlint.json
4641
"markdownlint.config": {
@@ -72,4 +67,4 @@
7267
"[jsonc]": {
7368
"editor.defaultFormatter": "vscode.json-language-features"
7469
},
75-
}
70+
}

.vscode/tasks.json

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"version": "2.0.0",
3-
43
"windows": {
54
"options": {
65
"shell": {
@@ -36,13 +35,12 @@
3635
}
3736
}
3837
},
39-
4038
"tasks": [
4139
{
4240
"label": "Bootstrap",
4341
"type": "shell",
44-
"command": "if (-not (Get-Module -ListAvailable -Name PSDepend)) { Install-Module -Name PSDepend -Scope CurrentUser -Force }; Invoke-PSDepend -Path '${workspaceFolder}/requirements.psd1' -Install -Import -Force",
45-
"problemMatcher": [ ]
42+
"command": "if (-not (Get-Module -ListAvailable -Name PSDepend)) { Install-Module -Name PSDepend -Scope CurrentUser -Force }; Invoke-PSDepend -Path '${workspaceFolder}/requirements.psd1' -Install -Import -Force -Verbose",
43+
"problemMatcher": []
4644
},
4745
{
4846
"label": "Clean Build",
@@ -51,7 +49,7 @@
5149
"group": {
5250
"kind": "build"
5351
},
54-
"problemMatcher": [ ]
52+
"problemMatcher": []
5553
},
5654
{
5755
"label": "Build",
@@ -61,54 +59,54 @@
6159
"kind": "build",
6260
"isDefault": true
6361
},
64-
"problemMatcher": [ ]
62+
"problemMatcher": []
6563
},
6664
{
6765
"label": "Test",
6866
"type": "shell",
6967
"command": "Invoke-Build Test",
7068
"group": "test",
71-
"problemMatcher": [ ]
69+
"problemMatcher": []
7270
},
7371
{
7472
"label": "UnitTests",
7573
"type": "shell",
7674
"command": "Invoke-Build UnitTests",
7775
"group": "test",
78-
"problemMatcher": [ ]
76+
"problemMatcher": []
7977
},
8078
{
8179
"label": "IntegrationTests",
8280
"type": "shell",
8381
"command": "Invoke-Build IntegrationTests",
8482
"group": "test",
85-
"problemMatcher": [ ]
83+
"problemMatcher": []
8684
},
8785
{
8886
"label": "PSScriptAnalyzer",
8987
"type": "shell",
9088
"command": "Invoke-Build PSScriptAnalyzer",
9189
"group": "test",
92-
"problemMatcher": [ ]
90+
"problemMatcher": []
9391
},
9492
{
9593
"label": "InjectionHunter",
9694
"type": "shell",
9795
"command": "Invoke-Build InjectionHunter",
9896
"group": "test",
99-
"problemMatcher": [ ]
97+
"problemMatcher": []
10098
},
10199
{
102100
"label": "Export-CommandHelp",
103101
"type": "shell",
104102
"command": "Invoke-Build Export-CommandHelp",
105-
"problemMatcher": [ ]
103+
"problemMatcher": []
106104
},
107105
{
108106
"label": "Clean",
109107
"type": "shell",
110108
"command": "Invoke-Build Clean",
111-
"problemMatcher": [ ]
109+
"problemMatcher": []
112110
}
113111
]
114112
}

PSScriptModule.build.ps1

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ param (
2323
)
2424

2525
# Synopsis: Default task
26-
task . Clean, Build
26+
Task . Clean, Build
2727

2828
# Setup build environment
2929
Enter-Build {
@@ -36,7 +36,7 @@ Enter-Build {
3636
}
3737

3838
# Synopsis: Analyze the project with PSScriptAnalyzer
39-
task PSScriptAnalyzer {
39+
Task PSScriptAnalyzer {
4040
if (-not (Test-Path $testOutputPath)) {
4141
[void] (New-Item -Path $testOutputPath -ItemType Directory)
4242
}
@@ -57,7 +57,7 @@ task PSScriptAnalyzer {
5757
}
5858

5959
# Synopsis: Scan the project with Injection Hunter
60-
task InjectionHunter {
60+
Task InjectionHunter {
6161

6262
$config = New-PesterConfiguration @{
6363
Run = @{
@@ -75,7 +75,7 @@ task InjectionHunter {
7575
}
7676

7777
# Synopsis: Run unit tests and generate code coverage report
78-
task UnitTests {
78+
Task UnitTests {
7979

8080
$container = New-PesterContainer -Path $Script:moduleSourcePath -Data @{ SourcePath = $script:moduleSourcePath }
8181
$config = New-PesterConfiguration @{
@@ -102,7 +102,7 @@ task UnitTests {
102102
}
103103

104104
# Synopsis: Run integration tests on built module
105-
task IntegrationTests {
105+
Task IntegrationTests {
106106
if (-not (Test-Path $testOutputPath)) {
107107
[void] (New-Item -Path $testOutputPath -ItemType Directory)
108108
}
@@ -136,10 +136,10 @@ task IntegrationTests {
136136
}
137137

138138
# Synopsis: Run all tests
139-
task Test UnitTests, PSScriptAnalyzer, InjectionHunter
139+
Task Test UnitTests, PSScriptAnalyzer, InjectionHunter
140140

141141
# Synopsis: Generate module help documentation
142-
task Export-CommandHelp {
142+
Task Export-CommandHelp {
143143

144144
# Import the module being built and PlatyPS module
145145
[void] (Import-Module (Join-Path -Path $buildPath -ChildPath "out/$moduleName/$moduleName.psd1") -Force)
@@ -182,7 +182,7 @@ task Export-CommandHelp {
182182
}
183183

184184
# Synopsis: Build the project
185-
task Build Clean, {
185+
Task Build Clean, {
186186

187187
# Copy src directory to ./build folder
188188
$requestParam = @{
@@ -206,17 +206,19 @@ task Build Clean, {
206206
# Build Powershell module
207207
[void] (Import-Module ModuleBuilder)
208208
$requestParam = @{
209-
Path = (Join-Path -Path $buildPath -ChildPath "src/$moduleName.psd1")
209+
SourcePath = (Join-Path -Path $buildPath -ChildPath "src/$moduleName.psd1")
210210
OutputDirectory = (Join-Path -Path $buildPath -ChildPath "out/$moduleName")
211+
Prefix = if (Test-Path (Join-Path -Path $buildPath -ChildPath "src/$moduleName.prefix.ps1")) { (Join-Path -Path $buildPath -ChildPath "src/$moduleName.prefix.ps1") } else { $null }
212+
Suffix = if (Test-Path (Join-Path -Path $buildPath -ChildPath "src/$moduleName.suffix.ps1")) { (Join-Path -Path $buildPath -ChildPath "src/$moduleName.suffix.ps1") } else { $null }
211213
SemVer = $SemanticVersion
212214
UnversionedOutputDirectory = $true
213-
ErrorAction = 'Stop'
215+
ErrorAction = [System.Management.Automation.ActionPreference]::Stop
214216
}
215217
Build-Module @requestParam
216218
}
217219

218220
# Synopsis: Create a NuGet package for the module
219-
task Package {
221+
Task Package {
220222
$packageOutputPath = Join-Path -Path $buildPath -ChildPath 'package'
221223
if (!(Test-Path $packageOutputPath)) {
222224
[void] (New-Item -Path $packageOutputPath -ItemType Directory -Force)
@@ -227,15 +229,15 @@ task Package {
227229
SourceLocation = $packageOutputPath
228230
PublishLocation = $packageOutputPath
229231
InstallationPolicy = 'Trusted'
230-
ErrorAction = 'Stop'
232+
ErrorAction = [System.Management.Automation.ActionPreference]::Stop
231233
}
232234
[void] (Register-PSRepository @requestParam)
233235

234236
$requestParam = @{
235237
Path = (Join-Path -Path $buildPath -ChildPath "out/$moduleName")
236238
Repository = "$($moduleName)_local_feed"
237239
NuGetApiKey = 'ABC123'
238-
ErrorAction = 'Stop'
240+
ErrorAction = [System.Management.Automation.ActionPreference]::Stop
239241
}
240242
[void] (Publish-Module @requestParam)
241243

@@ -244,17 +246,17 @@ task Package {
244246
}
245247

246248
# Synopsis: Publish the module to PSGallery
247-
task Publish -If ($NugetApiKey) {
249+
Task Publish -If ($NugetApiKey) {
248250
$requestParam = @{
249251
Path = (Join-Path -Path $buildPath -ChildPath "out/$moduleName")
250252
NuGetApiKey = $NugetApiKey
251-
ErrorAction = 'Stop'
253+
ErrorAction = [System.Management.Automation.ActionPreference]::Stop
252254
}
253255
[void] (Publish-Module @requestParam)
254256
}
255257

256258
# Synopsis: Clean up the target build directory
257-
task Clean {
259+
Task Clean {
258260
if (Test-Path $buildPath) {
259261
Write-Warning "Removing build output folder at '$buildPath'"
260262
$requestParam = @{

docs/help/Get-ModuleMetadata.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ external help file: PSScriptModule-Help.xml
44
HelpUri: https://github.com/YourUsername/PSScriptModule
55
Locale: en-US
66
Module Name: PSScriptModule
7-
ms.date: 01/26/2026
7+
ms.date: 03/23/2026
88
PlatyPS schema version: 2024-05-01
99
title: Get-ModuleMetadata
1010
---

requirements.psd1

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
11
@{
2+
# NOTE:
3+
# PSDependOptions with Target = 'CurrentUser' installs all declared module
4+
# dependencies into the current user's scope rather than system-wide.
5+
# This can impact multi-user development or shared build environments,
6+
# where each user/agent will get their own copy of the dependencies.
7+
PSDependOptions = @{
8+
Target = 'CurrentUser'
9+
}
210
'InvokeBuild' = @{
3-
'Version' = '5.14.22'
11+
'Version' = 'latest'
412
'Repository' = 'PSGallery'
513
}
614
'ModuleBuilder' = @{
7-
'Version' = '3.1.8'
15+
'Version' = 'latest'
816
'Repository' = 'PSGallery'
917
}
1018
'Pester' = @{
11-
'Version' = '5.7.1'
19+
'Version' = 'latest'
1220
'Repository' = 'PSGallery'
1321
}
1422
'PSScriptAnalyzer' = @{
15-
'Version' = '1.24.0'
23+
'Version' = 'latest'
1624
'Repository' = 'PSGallery'
1725
}
1826
'InjectionHunter' = @{
19-
'Version' = '1.0.0'
27+
'Version' = 'latest'
2028
'Repository' = 'PSGallery'
2129
}
2230
'Microsoft.PowerShell.PlatyPS' = @{
23-
'Version' = '1.0.1'
31+
'Version' = 'latest'
2432
'Repository' = 'PSGallery'
2533
}
2634
}

src/Classes/.gitkeep

Whitespace-only changes.

src/Enum/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)