-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
James Brundage
committed
Aug 11, 2023
1 parent
0dd88f9
commit 8bd6a18
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,7 @@ | |
Videos = 'Video' | ||
Demos = 'Demo' | ||
Tests = 'Test' | ||
Tips = 'Tip' | ||
Trick = 'Tip' | ||
Tricks = 'Tip' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<# | ||
.SYNOPSIS | ||
Get's a module's tips | ||
.DESCRIPTION | ||
Gets tips and tricks from a module. | ||
Any module can contain `*.tip(s)` or `*.trick(s)` files, of the extensions: | ||
* .md | ||
* .txt | ||
* .ps1 | ||
* .psd1 | ||
* .json | ||
* .clixml | ||
The collection of tips can be accessed in a Module's .Tip(s) or .Trick(s) properties | ||
#> | ||
if (-not $this.'.Tip') { | ||
$tipCollection = | ||
[PSCustomObject][Ordered]@{ | ||
PSTypeName = 'Posh.ExtensionCollection' | ||
Module = $posh | ||
Path = $this.Path | Split-Path | ||
CommandType = 'Posh.Tip.Command' | ||
} | ||
|
||
$tipCollection.pstypenames.insert(0,'Posh.Tip.Collection') | ||
$this | Add-Member NoteProperty '.Tip' $tipCollection -Force | ||
} | ||
$this.'.Tip' |