Skip to content

Commit

Permalink
v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhitsolutions committed Jul 22, 2022
1 parent 797a9d6 commit b455432
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 5 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ChangeLog for PSFunctionInfo

## 1.3.0

+ Updated missing online help links.
+ Help documentation updates.
+ Updated `README.md`.

## 1.2.0

+ Added custom error messages to `ValidateScript()` parameter attributes.
Expand Down
Binary file modified PSFunctionInfo.psd1
Binary file not shown.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ Source C:\scripts\FooStuff.ps1
}
```

Currently, there are no commands to modify or remove function metadata. It is assumed that when you update the function, you can update or remove the metadata.

### Backup

Because creating a PSFunctionInfo metadata comment block modifies the file, you might feel safer with a file backup. `New-PSFunctionInfo` has a `-BackupParameter` which will create a backup copy of the source file before inserting the metadata comment block. The file will be created in the same directory, appending an extension of .bak1. If there are previous backups, the number will increment, i.e. .bak2. You have to manually delete the backup files.
Expand Down Expand Up @@ -146,7 +144,7 @@ If you have an open file, in the integrated PowerShell console, you can run `New

![vscode integration](images/psfunctioninfo-vscode.png)

This example is taking advantage of saved defaults.
This example is taking advantage of saved defaults. See [`Set-PSFunctionInfoDefaults`](docs/Set-PSFunctionInfoDefaults.md)

### PowerShell ISE

Expand Down Expand Up @@ -180,6 +178,18 @@ Get-PSFunctionInfo Get-QOTD | Edit-PSFunctionInfo -editor ise

Once opened, you will need to navigate to the appropriate function and metadata section.

It is assumed you will normally edit function metadata when editing the script file. But you can use [`Set-PSFunctionInfo](docs/Set-PSFunctionInfo.md) to make changes from the console.

```powershell
PS C:\> Set-PSFunctionInfo -Name Get-Eventloginfo -Path c:\work\LogTools.ps1 -Tags "profile,eventlog" -Version "1.2.1"
```

If you want to clear an existing value, set the parameter value to `$null`.

```powershell
PS C:\> Set-PSFunctionInfo -Name Get-Eventloginfo -Path c:\work\LogTools.ps1 -Source $null
```

## Background

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")
Expand Down
2 changes: 1 addition & 1 deletion docs/Remove-PSFunctionInfo.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
external help file: PSFunctionInfo-help.xml
Module Name: PSFunctionInfo
online version:
online version: https://bit.ly/3Bffk55
schema: 2.0.0
---

Expand Down
2 changes: 1 addition & 1 deletion docs/Set-PSFunctionInfo.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
external help file: PSFunctionInfo-help.xml
Module Name: PSFunctionInfo
online version:
online version: https://bit.ly/3OBoaxi
schema: 2.0.0
---

Expand Down
8 changes: 8 additions & 0 deletions en-us/PSFunctionInfo-help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,10 @@ Web</dev:code>
</command:example>
</command:examples>
<command:relatedLinks>
<maml:navigationLink>
<maml:linkText>Online Version:</maml:linkText>
<maml:uri>https://bit.ly/3Bffk55</maml:uri>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Set-PSFunctionInfo</maml:linkText>
<maml:uri></maml:uri>
Expand Down Expand Up @@ -1536,6 +1540,10 @@ Web</dev:code>
</command:example>
</command:examples>
<command:relatedLinks>
<maml:navigationLink>
<maml:linkText>Online Version:</maml:linkText>
<maml:uri>https://bit.ly/3OBoaxi</maml:uri>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Get-PSFunctionInfo</maml:linkText>
<maml:uri></maml:uri>
Expand Down

0 comments on commit b455432

Please sign in to comment.