You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: ChangeLog.md
+17-2
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,29 @@
1
1
# ChangeLog for PSFunctionInfo
2
2
3
-
## 0.4.0
3
+
## 0.5.0-preview
4
+
5
+
+ Added an autocompleter for the `-Tag` parameter in `Get-PSFunctionInfo`. ([Issue #4](https://github.com/jdhitsolutions/PSFunctionInfo/issues/4))
6
+
+ Added a private function, `new_psfunctioninfo`, to create a new PSFunctionInfo object from the metadata block.
7
+
+ Changed `Name` parameter in `Get-PSFunctionInfo` to `FunctionName`. The parameter is positional, so it shouldn't make much difference. **This is a breaking change.**
8
+
+ Modified `Get-PSFunctionInfo` to get metadata from files. ([Issue #3](https://github.com/jdhitsolutions/PSFunctionInfo/issues/3))
9
+
+ Modified `PSFunctionInfo` class to not require Tags in the constructor.
10
+
+ Added missing online help links.
11
+
+ Added a table view called `tags` to `psfunctioninfor.format.ps1xml`.
12
+
+ Modified `psfunctioninfor.format.ps1xml` to reduce the `Alias` column to 15.
13
+
+ Added integration into the PowerShell ISE.
14
+
+ Added integration into VS Code. ([Issue #2](https://github.com/jdhitsolutions/PSFunctionInfo/issues/2))
15
+
+ Updated help documentation.
16
+
+ Updated `README.md`.
17
+
18
+
## 0.4.0-preview
4
19
5
20
+ Added `Set-PSFunctionInfoDefaults` and `Get-PSFunctionInfoDefaults` to store default values. The defaults are stored in a JSON file at `$home\psfunctioninfo-defaults.json`. If the file is found when the module is imported, it will be used to set $PSDefaultParameterValues for this module.
6
21
+ Added `Update-PSFunctionInfoDefaults` which can be used to update defaults if they are changed after the module has been loaded.
7
22
+ Added `about_PSFunctionInfo` help.
8
23
+ Minor help updates.
9
24
+ Updated `README.md`.
10
25
11
-
## 0.3.0
26
+
## 0.3.0-preview
12
27
13
28
+ Added online help links.
14
29
+ Published pre-release module to the PowerShell Gallery.
This module contains a set of PowerShell commands to add and manage metadata in stand-alone PowerShell functions.
@@ -18,7 +20,7 @@ The module should work on both Windows PowerShell and PowerShell 7.x, even cross
18
20
19
21
The purpose of this code is to provide a way to get versioning and other metadata information for functions that may not belong to a module. This is information you want to get after the function has been loaded into your PowerShell session. I have numerous stand-alone functions. These functions don't belong to a module, so there is no version or source information. However, I'd like to use that type of information for non-module files.
20
22
21
-
The code in this module isn't concerned with loading, running, or finding functions. It queries whatever is in the `Function:` PSDrive. If the PowerShell function belongs to a module, then you'll get the module version and source. Otherwise, you can use the function metadata.
23
+
The code in this module isn't concerned with loading, running, or finding functions. By default, [Get-PSFunctionInfo](docs/Get-PSFunctionInfo.md) queries whatever is in the `Function:` PSDrive. If the PowerShell function belongs to a module, then you'll get the module version and source. Otherwise, you can use the function metadata.
22
24
23
25

24
26
@@ -30,9 +32,28 @@ You can also get functions by tag. Use `Get-PSFunctionInfoTag` to get a list of
30
32
31
33

32
34
35
+
The PSFunctionInfo object includes a PropertySet called AuthorInfo.
Description : Test if help file is missing the online link
47
+
LastUpdate : 4/23/2021 9:21:00 AM
48
+
```
49
+
50
+
Finally, you can also search .ps1 files for PSFunctionInfo metadata.
51
+
52
+

53
+
33
54
## Creating PSFunctionInfo
34
55
35
-
Use the `New-PSFunctionInfo` command to insert the metadata tag into your script file.
56
+
Use the [New-PSFunctionInfo](docs/New-PSFunctionInfo.md) command to insert the metadata tag into your script file.
36
57
37
58
```powershell
38
59
New-PSFunctionInfo -Path c:\scripts\Test-ConsoleColors.ps1 -Description "show console color combinations" -Name Test-ConsoleColor -Author "Jeff Hicks" -CompanyName "JDH IT Solutions" -Copyright "2021 JDH IT Solutions, Inc." -Tags "scripting","console"
@@ -91,24 +112,51 @@ There are no commands to modify or remove function metadata. It is assumed that
91
112
92
113
## PSFunctionInfo Defaults
93
114
94
-
Because you might define function metadata often, and want to maintain consistency, you can define a set of default values for `New-PSFunctionInfo`. Use the command, `Set-PSFunctionInfoDefaults`:
115
+
Because you might define function metadata often, and want to maintain consistency, you can define a set of default values for `New-PSFunctionInfo`. Use the command, [Set-PSFunctionInfoDefaults](docs/Set-PSFunctionInfoDefaults):
95
116
96
117
```powershell
97
118
Set-PSFunctionInfoDefaults -Tags "stand-alone" -Copyright "(c) JDH IT Solutions, Inc." -author "Jeff Hicks" -company "JDH IT Solutions, Inc."
98
119
```
99
120
100
-
The defaults will be stored in a JSON file at `$home\psfunctioninfo-defaults.json`. When you import this module, these values will be used to define entries in `$PSDefaultParameterValues`. Or, run `Update-PSFunctionInfoDefaults` to update parameter defaults.
121
+
The defaults will be stored in a JSON file at `$home\psfunctioninfo-defaults.json`. When you import this module, these values will be used to define entries in `$PSDefaultParameterValues`. Or, run [Update-PSFunctionInfoDefaults](docs/Update-PSFunctionInfoDefaults) to update parameter defaults.
122
+
123
+
You can use [Get-PSFunctionInfoDefaults](docs/Get-PSFunctionInfoDefaults.md) to see the current values.
124
+
125
+
## Editor Integration
126
+
127
+
When you import the module into an editor, you will get additional features to make it easier to insert PSFunctionInfo metadata into your file. It is recommended that you explicitly import the module into the editor's integrated console session. You could add an `Import-Module PSFunctionInfo` command into the editor's PowerShell profile script.
101
128
102
-
You can use `Get-PSFunctionInfoDefaults` to see the current values.
129
+
### Visual Studio Code
130
+
131
+
If you have an open file, in the integrated PowerShell console, you can run `New-PSFunctionfo` and press <kbd>TAB</kbd> to tab-complete the detected functions in the current file. The file path will automatically be detected. You can enter other values such as version, or simply press <kbd>ENTER</kbd> to insert the metadata, which you can then edit.
This example is taking advantage of saved defaults.
136
+
137
+
### PowerShell ISE
138
+
139
+
When you import the module in the PowerShell ISE, it will add a menu shortcut.
140
+
141
+

142
+
143
+
With a loaded file, you could run `New-PSFunctionInfo` in the console specifying the function name. The Path will be auto-detected. Or use the menu shortcut which will give you a graphical "function picker"
Select a function and click OK. The metadata block will be inserted into the file. This will not work with a file that has unsaved changes. When you insert new function metadata, the file in the ISE will be closed, re-opened, and focus should jump to the function.
148
+
149
+

103
150
104
151
## Background
105
152
106
153
This code is a prototype for a [suggestion](https://github.com/PowerShell/PowerShell/issues/11667) I made for PowerShell 7. Early versions of this code were published as [https://gist.github.com/jdhitsolutions/65070cd51b5cfb572bc6375f67bcbc3d](https://gist.github.com/jdhitsolutions/65070cd51b5cfb572bc6375f67bcbc3d"view the Github gist")
107
154
155
+
This module was first described at <https://jdhitsolutions.com/blog/powershell/8343/a-better-way-to-manage-powershell-functions/>.
156
+
108
157
## Roadmap
109
158
110
159
+ Add VS Code integration.
111
-
+ Extract function metadata from files directly.
112
160
+ Add function metadata by file, autodetecting the function name.
0 commit comments