Skip to content

Commit 797a9d6

Browse files
v1.2.0
1 parent cbbb7c1 commit 797a9d6

14 files changed

+1218
-23
lines changed

ChangeLog.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
# ChangeLog for PSFunctionInfo
22

3+
## 1.2.0
4+
5+
+ Added custom error messages to `ValidateScript()` parameter attributes.
6+
+ Added a `NoSource` parameter to `New-PSFunctionInfo` to not include the source path.
7+
+ Added `Set-PSFunctionInfo` and its alias `spfi`.
8+
+ Added `Remove-PSFunctionInfo` and its alias `rpfi`.
9+
+ Help updates.
10+
+ Updated `README.md`.
11+
312
## 1.1.0
413

514
+ Fixed DefaultDisplayPropertySet in types.ps1xml file.
615
+ Added online help links.
7-
+ Updated `README`.
16+
+ Updated `README.md`.
817

918
## 1.0.0
1019

PSFunctionInfo.psd1

118 Bytes
Binary file not shown.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,5 +189,4 @@ This module was first described at <https://jdhitsolutions.com/blog/powershell/8
189189
## Roadmap
190190

191191
+ Add function metadata by file, autodetecting the function name.
192-
+ Consider a bulk editing command.
193192
+ Consider a bulk removal command to clean PSFunctionInfo metadata from files.

docs/Edit-PSFunctionInfo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The editor choices are VS Code, PowerShell ISE, or Notepad. Of course they are a
3939
PS C:\> Edit-PSFunctionInfo -name Set-Title -editor ise
4040
```
4141

42-
Open the source file for the Set-Title function and open in the PowerShell ISE.
42+
Open the source file for the Set-Title function and open in the PowerShell ISE. This assumes the Set-Title function is currently loaded into your PowerShell session.
4343

4444
### Example 2
4545

docs/Get-PSFunctionInfo.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Get-PSFunctionInfo [-Path <String>] [-Tag <String>] [<CommonParameters>]
2929

3030
Get-PSFunctionIfo will display function metadata that was created using New-PSFunctionInfo. The default behavior is to search loaded functions that don't belong to a module and display the custom function metadata.
3131

32-
As an alternative to searching items in the Function: PSDrive, you can also search .ps1 files.
32+
As an alternative to searching items in the Function: PSDrive, you can also search .ps1 files. If you specify the path to a script file, you will get function metadata for every defined function in the file.
3333

3434
## EXAMPLES
3535

@@ -179,6 +179,20 @@ LastUpdate : 4/23/2021 9:21:00 AM
179179

180180
The PSFunctionInfo object includes a PropertySet called AuthorInfo.
181181

182+
### Example 8
183+
184+
```powershell
185+
186+
PS C:\> Get-PSFunctionInfo -Path C:\work\sample.ps1
187+
188+
Name Version Alias Source
189+
---- ------- ----- ------
190+
Get-EventlogInfo 1.0.0
191+
Test-EventLog 1.0.0 C:\work\sample.ps1
192+
```
193+
194+
Get function metadate for every function in the specified file.
195+
182196
## PARAMETERS
183197

184198
### -Tag
@@ -254,3 +268,5 @@ Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell
254268
[Get-PSFunctionInfoTag](Get-PSFunctionInfoTag.md)
255269
256270
[Edit-PSFunctionInfo](Edit-PSFunctionInfo.md)
271+
272+
[Set-PSFunctionInfo](Set-PSFunctionInfo.md)

docs/New-PSFunctionInfo.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,3 +298,7 @@ Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell
298298
[Get-PSFunctionInfo](Get-PSFunctionInfo.md)
299299
300300
[Edit-PSFunctionInfo](Edit-PSFunctionInfo.md)
301+
302+
[Remove-PSFunctionInfo](Remove-PSFunctionInfo.md)
303+
304+
[Set-PSFunctionInfo](Set-PSFunctionInfo.md)

docs/Remove-PSFunctionInfo.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
external help file: PSFunctionInfo-help.xml
3+
Module Name: PSFunctionInfo
4+
online version:
5+
schema: 2.0.0
6+
---
7+
8+
# Remove-PSFunctionInfo
9+
10+
## SYNOPSIS
11+
12+
Remove PSFunctoinInfo metatdata.
13+
14+
## SYNTAX
15+
16+
```yaml
17+
Remove-PSFunctionInfo [-FunctionName] <String> -Path <String> [-WhatIf] [-Confirm] [<CommonParameters>]
18+
```
19+
20+
## DESCRIPTION
21+
22+
Use this function to remove the PSFunctionInfo metadata for a given function.
23+
24+
## EXAMPLES
25+
26+
### Example 1
27+
28+
```powershell
29+
PS C:\> Remove-PSFunctionInfo Test-Eventlog -path c:\work\eventlogtools.ps1
30+
```
31+
32+
Remove the entry for the given function.
33+
34+
### Example 2
35+
36+
```powershell
37+
PS C:\> Get-PSFunctioninfo -Path c:\work\tools.ps1 | Remove-PSFunctionInfo
38+
```
39+
40+
Get PSFUnctionInfo for all functions from the specified file and remove them. This assumes that every function has a source value that reflects c:\work\tools.ps1. Otherwise, you could specify the Path parameter with Remove-PSFunctionInfo.
41+
42+
## PARAMETERS
43+
44+
### -Confirm
45+
46+
Prompts you for confirmation before running the cmdlet.
47+
48+
```yaml
49+
Type: SwitchParameter
50+
Parameter Sets: (All)
51+
Aliases: cf
52+
53+
Required: False
54+
Position: Named
55+
Default value: None
56+
Accept pipeline input: False
57+
Accept wildcard characters: False
58+
```
59+
60+
### -FunctionName
61+
62+
Specify the name of a function that doesn't belong to a module.
63+
64+
```yaml
65+
Type: String
66+
Parameter Sets: (All)
67+
Aliases: Name
68+
69+
Required: True
70+
Position: 0
71+
Default value: None
72+
Accept pipeline input: True (ByPropertyName)
73+
Accept wildcard characters: False
74+
```
75+
76+
### -Path
77+
78+
Specify the source .ps1 file for the function.
79+
80+
```yaml
81+
Type: String
82+
Parameter Sets: (All)
83+
Aliases: fullname, source
84+
85+
Required: True
86+
Position: Named
87+
Default value: None
88+
Accept pipeline input: True (ByPropertyName)
89+
Accept wildcard characters: False
90+
```
91+
92+
### -WhatIf
93+
94+
Shows what would happen if the cmdlet runs.
95+
The cmdlet is not run.
96+
97+
```yaml
98+
Type: SwitchParameter
99+
Parameter Sets: (All)
100+
Aliases: wi
101+
102+
Required: False
103+
Position: Named
104+
Default value: None
105+
Accept pipeline input: False
106+
Accept wildcard characters: False
107+
```
108+
109+
### CommonParameters
110+
111+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
112+
113+
## INPUTS
114+
115+
### System.String
116+
117+
## OUTPUTS
118+
119+
### None
120+
121+
## NOTES
122+
123+
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/
124+
125+
## RELATED LINKS
126+
127+
[Set-PSFunctionInfo](Set-PSFunctionInfo.md)
128+
129+
[Get-PSFunctionInfo](Get-PSFunctionInfo.md)

0 commit comments

Comments
 (0)