Skip to content

Commit 6f45d13

Browse files
🩹 [Patch]: Add example of nested docs (#12)
## Description This pull request introduces several updates to the PSModule functions, including module dependency updates, file restructuring, and new documentation. It also adds a custom argument completer for the `New-PSModuleTest` command. The most important changes are summarized below: ### Module dependency updates and file restructuring * Updated module dependencies in `Get-PSModuleTest.ps1` and `New-PSModuleTest.ps1` to require newer versions of `PSSemVer`, and added dependencies on `DynamicParams` and `Store`. Both files were also moved into the `PSModule` subfolder and renamed accordingly. [[1]](diffhunk://#diff-fba04a7dcc2a3fdf6ced8c431c15ae38c72351bd21fec3705f09d1fbb19343b0R2-R4) [[2]](diffhunk://#diff-67673b63bb813016a3286857ec190afb041ce4352b18c7ba8571de3d6213e771L1-R1) * Updated `.github/PSModule.yml` to configure the linter environment variable `VALIDATE_BIOME_FORMAT` to `false`. ### New features * Added a custom argument completer in `completers.ps1` for the `New-PSModuleTest` command's `Name` parameter, providing suggestions such as 'Alice', 'Bob', and 'Charlie'. ### Documentation * Added a new markdown documentation file `PSModule.md` in the `PSModule` folder. * Added a new markdown documentation file `SomethingElse.md` in the `SomethingElse` folder.
1 parent 09d5e70 commit 6f45d13

File tree

7 files changed

+15
-1
lines changed

7 files changed

+15
-1
lines changed

‎.github/PSModule.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Test:
2020
# Build:
2121
# Docs:
2222
# Skip: true
23+
2324
Linter:
2425
env:
2526
VALIDATE_BIOME_FORMAT: false

src/functions/public/Get-PSModuleTest.ps1 renamed to src/functions/public/PSModule/Get-PSModuleTest.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#Requires -Modules Utilities
2+
#Requires -Modules @{ ModuleName = 'PSSemVer'; RequiredVersion = '1.1.4' }
3+
#Requires -Modules @{ ModuleName = 'DynamicParams'; ModuleVersion = '1.1.8' }
4+
#Requires -Modules @{ ModuleName = 'Store'; ModuleVersion = '0.3.1' }
25

36
function Get-PSModuleTest {
47
<#

src/functions/public/New-PSModuleTest.ps1 renamed to src/functions/public/PSModule/New-PSModuleTest.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Requires -Modules @{ModuleName='PSSemVer'; ModuleVersion='1.0'}
1+
#Requires -Modules @{ModuleName='PSSemVer'; ModuleVersion='1.1.4'}
22

33
function New-PSModuleTest {
44
<#
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This is PSModule
File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This is SomethingElse
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Register-ArgumentCompleter -CommandName New-PSModuleTest -ParameterName Name -ScriptBlock {
2+
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters)
3+
$null = $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters
4+
5+
'Alice', 'Bob', 'Charlie' | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
6+
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
7+
}
8+
}

0 commit comments

Comments
 (0)