Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhitsolutions committed Mar 3, 2023
1 parent de77a07 commit 9915cbb
Show file tree
Hide file tree
Showing 41 changed files with 263 additions and 251 deletions.
2 changes: 1 addition & 1 deletion License.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 JDH Information Technology Solutions, Inc.
Copyright (c) 2022-2023 JDH Information Technology Solutions, Inc.


Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
4 changes: 2 additions & 2 deletions PSFunctionTools.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

@{
RootModule = 'PSFunctionTools.psm1'
ModuleVersion = '1.0.0'
ModuleVersion = '1.1.0'
CompatiblePSEditions = 'Core'
GUID = '151466e0-a952-4b6a-ad81-40dafc9ef9bb'
Author = 'Jeff Hicks'
CompanyName = 'JDH Information Technology Solutions, Inc.'
Copyright = '(c) 2021-2022 JDH Information Technology Solutions, Inc.'
Copyright = '(c) 2021-2023 JDH Information Technology Solutions, Inc.'
Description = 'A set of PowerShell commands for managing and automating PowerShell scripts, functions, and modules.'
PowerShellVersion = '7.1'
# TypesToProcess = @()
Expand Down
2 changes: 1 addition & 1 deletion PSFunctionTools.psm1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Get-Childitem $psscriptroot\functions\*.ps1 -recurse |
Get-Childitem $PSScriptRoot\functions\*.ps1 -recurse |
Foreach-Object {
. $_.FullName
}
Expand Down
93 changes: 50 additions & 43 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,72 @@
# Changelog for PSFunctionTools

## v1.1.0

### Changed

- Code clean up and reformatting.
- Image resizing.

## v1.0.0

+ Added online help links for previously published commands.
+ Bumped version number to reflect feature-complete release.
+ Added `Export-FunctionToFile` to export a loaded function from your session to a script file.
+ Help updates.
+ Updated `README.md`.
- Added online help links for previously published commands.
- Bumped version number to reflect feature-complete release.
- Added `Export-FunctionToFile` to export a loaded function from your session to a script file.
- Help updates.
- Updated `README.md`.

## v0.6.0

+ Added online help links for previously published commands.
+ Modified `Get-FunctionAttribute` to accept pipeline input for `Name` and `Path` parameters.
+ Modified `Get-FunctionAlias` to accept pipeline input for `Path`.
+ Added command `Get-PSFunctionTools` and a related custom format file. This command makes it easy to see all module commands.
+ Added alias `ffn` for `Format-FunctionName`.
+ Added alias `gfn` for `Get-FunctionName`.
+ Added alias `tfn` for `Test-FunctionName`.
+ Added command `Get-FunctionProfile` and alias `gfp`.
+ Revised warning message in `Get-FunctionAttribute` and `Get-ParameterBlock` to include function name and path.
+ Updated `README.md`.
+ Help updates.
+ Initial public release to the PowerShell Gallery.
- Added online help links for previously published commands.
- Modified `Get-FunctionAttribute` to accept pipeline input for `Name` and `Path` parameters.
- Modified `Get-FunctionAlias` to accept pipeline input for `Path`.
- Added command `Get-PSFunctionTools` and a related custom format file. This command makes it easy to see all module commands.
- Added alias `ffn` for `Format-FunctionName`.
- Added alias `gfn` for `Get-FunctionName`.
- Added alias `tfn` for `Test-FunctionName`.
- Added command `Get-FunctionProfile` and alias `gfp`.
- Revised warning message in `Get-FunctionAttribute` and `Get-ParameterBlock` to include function name and path.
- Updated `README.md`.
- Help updates.
- Initial public release to the PowerShell Gallery.

## v0.5.0

+ Module will be written to support PowerShell 7.1 and later. Commands may run in Windows PowerShell but I am __not__ marking the module as `Desktop` compatible.
+ Added a parameter called `AsTree` to `Get-ModuleLayout` to show module layout as a tree.
+ Moved code to parse path for `AST` data to a private helper function.
+ Help documentation updates.
+ Initial Pester 5 tests for the module and functions.
+ Module manifest updates.
+ Updated `README.md`.
+ First public preview release.
- Module will be written to support PowerShell 7.1 and later. Commands may run in Windows PowerShell but I am __not__ marking the module as `Desktop` compatible.
- Added a parameter called `AsTree` to `Get-ModuleLayout` to show module layout as a tree.
- Moved code to parse path for `AST` data to a private helper function.
- Help documentation updates.
- Initial Pester 5 tests for the module and functions.
- Module manifest updates.
- Updated `README.md`.
- First public preview release.

## v0.4.0

+ Moved helper functions in `New-ModuleFromFiles` to `functions\private\helpers.ps1'`.
+ Updated `New-ModuleFromFiles` to use `Functionpath` parameter when creating the root psm1 file.
+ Added function `New-ModuleFromLayout`.
+ Help updates.
- Moved helper functions in `New-ModuleFromFiles` to `functions\private\helpers.ps1'`.
- Updated `New-ModuleFromFiles` to use `Functionpath` parameter when creating the root psm1 file.
- Added function `New-ModuleFromLayout`.
- Help updates.

## v0.3.0

+ Added sample scripts.
+ Modified `New-CommentHelp` with a `-TemplateOnly` parameter to generate help without any parameter definitions.
+ Modified `Get-FunctionName` to accept `Path` parameter values from pipeline input.
+ Modified `Get-ParameterBlock` to accept `Path` and `Name` values from pipeline input by property name.
+ Added function `New-ModuleFromFiles`. This should be considered experimental.
- Added sample scripts.
- Modified `New-CommentHelp` with a `-TemplateOnly` parameter to generate help without any parameter definitions.
- Modified `Get-FunctionName` to accept `Path` parameter values from pipeline input.
- Modified `Get-ParameterBlock` to accept `Path` and `Name` values from pipeline input by property name.
- Added function `New-ModuleFromFiles`. This should be considered experimental.

## v0.2.0

+ Updated help documentation.
+ Modified `Format-FunctionName` to accept pipeline input by value.
+ Added function `Get-ParameterBlock` with an alias of `gpb`.
+ Added function `Get-FunctionAttribute` with an alias of `gfa`.
+ Added a parameter called `Detailed` to `Get-FunctionName` to write a custom object to the pipeline which includes the path to the file. Added a custom format file `psfunctionname.format.ps1xml`.
- Updated help documentation.
- Modified `Format-FunctionName` to accept pipeline input by value.
- Added function `Get-ParameterBlock` with an alias of `gpb`.
- Added function `Get-FunctionAttribute` with an alias of `gfa`.
- Added a parameter called `Detailed` to `Get-FunctionName` to write a custom object to the pipeline which includes the path to the file. Added a custom format file `psfunctionname.format.ps1xml`.

## v0.1.0

+ Initial files.
+ Added `Get-ModuleLayout` with format file `modulelayout.format.ps1xml`.
+ Modified `Get-PSScriptRequirements` to write a `PSScriptRequirements` object to the pipeline. Added the format file `psscriptrequirements.format.ps1xml`.
+ Updated help documentation.
- Initial files.
- Added `Get-ModuleLayout` with format file `modulelayout.format.ps1xml`.
- Modified `Get-PSScriptRequirements` to write a `PSScriptRequirements` object to the pipeline. Added the format file `psscriptrequirements.format.ps1xml`.
- Updated help documentation.
8 changes: 4 additions & 4 deletions docs/Export-FunctionFromFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ Export a PowerShell function from a script file.
### All (Default)

```yaml
Export-FunctionFromFile [-Path] <String> [-OutputPath <String>] [-Passthru]
Export-FunctionFromFile [-Path] <String> [-OutputPath <String>] [-PassThru]
[-Remove] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### byName

```yaml
Export-FunctionFromFile [-Path] <String> [-OutputPath <String>]
[-Name <String[]>] [-Passthru] [-Remove] [-WhatIf] [-Confirm] [<CommonParameters>]
[-Name <String[]>] [-PassThru] [-Remove] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### all

```yaml
Export-FunctionFromFile [-Path] <String> [-OutputPath <String>] [-All] [-Remove] [-Passthru] [-WhatIf] [-Confirm] [<CommonParameters>]
Export-FunctionFromFile [-Path] <String> [-OutputPath <String>] [-All] [-Remove] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -125,7 +125,7 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -Passthru
### -PassThru
Pass the output file to the pipeline.
Expand Down
6 changes: 3 additions & 3 deletions docs/Export-FunctionToFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Export a PowerShell function to a file.
## SYNTAX

```yaml
Export-FunctionToFile [-Name] <String> [-Path <String>] [-Passthru] [-Requires <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
Export-FunctionToFile [-Name] <String> [-Path <String>] [-PassThru] [-Requires <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -34,7 +34,7 @@ Get the prompt function from your PowerShell session and export it to C:\Scripts
### Example 2

```powershell
PS C:\> Export-FunctionToFile -Name New-FileLink -Path c:\work -Requires "#requires -version 5.1","#requires -RunAsAdministrator" -Passthru
PS C:\> Export-FunctionToFile -Name New-FileLink -Path c:\work -Requires "#requires -version 5.1","#requires -RunAsAdministrator" -PassThru
Directory: C:\work
Expand Down Expand Up @@ -79,7 +79,7 @@ Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -Passthru
### -PassThru
Show the file result.
Expand Down
4 changes: 2 additions & 2 deletions docs/Export-ModuleLayout.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Export a model module layout.

```yaml
Export-ModuleLayout -SourcePath <String> [-Version <String>]
[-FilePath <String>] [-Passthru] [<CommonParameters>]
[-FilePath <String>] [-PassThru] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -77,7 +77,7 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -Passthru
### -PassThru
Show the file result.
Expand Down
16 changes: 8 additions & 8 deletions en-us/PSFunctionTools-help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Passthru</maml:name>
<maml:name>PassThru</maml:name>
<maml:description>
<maml:para>Pass the output file to the pipeline.</maml:para>
</maml:description>
Expand Down Expand Up @@ -286,7 +286,7 @@
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Passthru</maml:name>
<maml:name>PassThru</maml:name>
<maml:description>
<maml:para>Pass the output file to the pipeline.</maml:para>
</maml:description>
Expand Down Expand Up @@ -370,7 +370,7 @@
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Passthru</maml:name>
<maml:name>PassThru</maml:name>
<maml:description>
<maml:para>Pass the output file to the pipeline.</maml:para>
</maml:description>
Expand Down Expand Up @@ -521,7 +521,7 @@
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Passthru</maml:name>
<maml:name>PassThru</maml:name>
<maml:description>
<maml:para>Show the file result.</maml:para>
</maml:description>
Expand Down Expand Up @@ -594,7 +594,7 @@
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Passthru</maml:name>
<maml:name>PassThru</maml:name>
<maml:description>
<maml:para>Show the file result.</maml:para>
</maml:description>
Expand Down Expand Up @@ -685,7 +685,7 @@
</command:example>
<command:example>
<maml:title>-------------------------- Example 2 --------------------------</maml:title>
<dev:code>PS C:\&gt; Export-FunctionToFile -Name New-FileLink -Path c:\work -Requires "#requires -version 5.1","#requires -RunAsAdministrator" -Passthru
<dev:code>PS C:\&gt; Export-FunctionToFile -Name New-FileLink -Path c:\work -Requires "#requires -version 5.1","#requires -RunAsAdministrator" -PassThru

Directory: C:\work

Expand Down Expand Up @@ -732,7 +732,7 @@ Mode LastWriteTime Length Name
<dev:defaultValue>modulelayout.json</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Passthru</maml:name>
<maml:name>PassThru</maml:name>
<maml:description>
<maml:para>Show the file result.</maml:para>
</maml:description>
Expand Down Expand Up @@ -782,7 +782,7 @@ Mode LastWriteTime Length Name
<dev:defaultValue>modulelayout.json</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
<maml:name>Passthru</maml:name>
<maml:name>PassThru</maml:name>
<maml:description>
<maml:para>Show the file result.</maml:para>
</maml:description>
Expand Down
10 changes: 5 additions & 5 deletions functions/private/helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ Function _mkHelp {
#the path to the psd1 file
[string]$ModulePath,
#where to put the md files
[string]$Markdownpath,
[string]$MarkdownPath,
#where to put the xml output
[string]$OutputPath
)

Write-Verbose "Invoking Import-Module on $modulepath"
Write-Verbose "Invoking Import-Module on $ModulePath"
Import-Module -Name $ModulePath -Scope global
$ModuleName = (Get-Item $ModulePath).BaseName
Get-Command -Module $NewModuleName -OutVariable modcmds | Out-String | Write-Verbose
Write-Verbose "Invoking New-MarkdownHelp for module $modulename"
Write-Verbose "Invoking New-MarkdownHelp for module $ModuleName"
Try {
New-MarkdownHelp -Module $modulename -OutputFolder $Markdownpath -Force -ErrorAction Stop
New-MarkdownHelp -Module $ModuleName -OutputFolder $MarkdownPath -Force -ErrorAction Stop
Write-Verbose "Invoking New-Externalhelp to $outputPath"
New-ExternalHelp -Path $Markdownpath -OutputPath $OutputPath -Force -ErrorAction Stop
New-ExternalHelp -Path $MarkdownPath -OutputPath $OutputPath -Force -ErrorAction Stop
}
Catch {
Write-Warning "Failed to generate help content. $($_.exception.message)"
Expand Down
Loading

0 comments on commit 9915cbb

Please sign in to comment.