Skip to content

Commit e12b2c1

Browse files
v1.2.0
1 parent 3e80c92 commit e12b2c1

35 files changed

Lines changed: 606 additions & 545 deletions

PSFunctionTools.psd1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
@{
66
RootModule = 'PSFunctionTools.psm1'
7-
ModuleVersion = '1.1.0'
7+
ModuleVersion = '1.2.0'
88
CompatiblePSEditions = 'Core'
99
GUID = '151466e0-a952-4b6a-ad81-40dafc9ef9bb'
1010
Author = 'Jeff Hicks'
1111
CompanyName = 'JDH Information Technology Solutions, Inc.'
1212
Copyright = '(c) 2021-2023 JDH Information Technology Solutions, Inc.'
13-
Description = 'A set of PowerShell commands for managing and automating PowerShell scripts, functions, and modules.'
13+
Description = 'A set of PowerShell 7 commands for managing and automating PowerShell scripts, functions, and modules. You can use these tools to accelerate PowerShell script development.'
1414
PowerShellVersion = '7.1'
1515
# TypesToProcess = @()
1616
FormatsToProcess = @('formats\modulelayout.format.ps1xml',
@@ -25,7 +25,8 @@
2525
'Get-PSRequirements', 'New-CommentHelp', 'Format-FunctionName',
2626
'Get-ModuleLayout', 'Get-ParameterBlock', 'Get-FunctionAttribute',
2727
'Get-FunctionProfile', 'New-ModuleFromFiles', 'New-ModuleFromLayout',
28-
'Get-PSFunctionTools','Export-FunctionToFile')
28+
'Get-PSFunctionTools','Export-FunctionToFile'
29+
)
2930
CmdletsToExport = @()
3031
# VariablesToExport = @()
3132
AliasesToExport = @('gfal', 'ga', 'eff', 'eml', 'iml', 'csf', 'gpb',
@@ -44,4 +45,3 @@
4445
} # End of PSData hashtable
4546
} # End of PrivateData hashtable
4647
}
47-

PSFunctionTools.psm1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

2-
Get-Childitem $PSScriptRoot\functions\*.ps1 -recurse |
2+
Get-ChildItem $PSScriptRoot\functions\*.ps1 -recurse |
33
Foreach-Object {
44
. $_.FullName
55
}
6-

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To see a summary of these commands at any time, run [Get-PSFunctionTools](docs/G
2323
```dos
2424
PS C:\> Get-PSFunctionTools
2525
26-
Module: PSFunctionTools [v1.0.0]
26+
Module: PSFunctionTools [v1.2.0]
2727
2828
Name Alias Synopsis
2929
---- ----- --------
@@ -43,7 +43,7 @@ Get-PSRequirements List PowerShell command requirements.
4343
Import-ModuleLayout iml Create a module structure from a layout fil…
4444
New-CommentHelp nch Create comment based help.
4545
New-ModuleFromFiles Create a PowerShell module from a set of fi…
46-
New-ModuleFromLayout Creat a new module based on a layout.
46+
New-ModuleFromLayout Create a new module based on a layout.
4747
Test-FunctionName tfn Test the validity of a PowerShell function …
4848
```
4949

@@ -124,7 +124,7 @@ Test-Data
124124

125125
### [Get-FunctionAlias](docs/Get-FunctionAlias.md)
126126

127-
`Get-FunctionAlias` is a tool you can use in your scripting automation. It will extract function names and aliases from a PowerShell script file. The source must be a .ps1 or .psm1 file. The command will only idenfity aliases defined as part of the function using code like `[alias('foo')]`.
127+
`Get-FunctionAlias` is a tool you can use in your scripting automation. It will extract function names and aliases from a PowerShell script file. The source must be a .ps1 or .psm1 file. The command will only identify aliases defined as part of the function using code like `[alias('foo')]`.
128128

129129
```dos
130130
PS C:\> Get-FunctionAlias -Path C:\scripts\SQLBackup.psm1
@@ -221,7 +221,7 @@ Attributes Parameters Extent
221221
---------- ---------- ------
222222
{} {$Path, $Cutoff, $Filter} Param (…
223223
224-
PS C:\> Get-Parameterblock -path c:\scripts\SimpleFunction.ps1 -name Get-FolderData -ToString
224+
PS C:\> Get-ParameterBlock -path c:\scripts\SimpleFunction.ps1 -name Get-FolderData -ToString
225225
[parameter(HelpMessage = "Specify the folder to analyze")]
226226
[string]$Path="."
227227
[datetime]$Cutoff
@@ -446,3 +446,13 @@ You are welcome to copy, paste, and edit these samples as much as you would like
446446
## Bugs and Enhancements
447447

448448
Please use the repository's Issues section for reporting bugs and requesting new features. Remember, the commands in this module are designed for PowerShell 7.1 and later.
449+
450+
## Related Commands and Projects
451+
452+
You might also be interested in the [PSScriptTools](https://github.com/jdhitsolutions/PSScriptTools) module. This module has several commands that you might use in your toolmaking.
453+
454+
+ [New-PSFormatXML](http://bit.ly/31SGo5o)
455+
+ [New-PSDynamicParameterForm](https://bit.ly/3HNNcpU)
456+
+ [New-PSDynamicParameter](https://bit.ly/3JX8R0w)
457+
458+
Use the commands in the [PSTypeExtensionTools](https://github.com/jdhitsolutions/PSTypeExtensionTools) to extend standard types as well as custom types and classes in your work.

changelog.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog for PSFunctionTools
22

3+
## v1.2.0
4+
5+
### Changed
6+
7+
- Pester test revisions.
8+
- Modified `Format-FunctionName` to let you capitalize N number of characters in the Noun portion of your command name.
9+
- Help updates.
10+
- Updated `README.md`.
11+
12+
### Added
13+
14+
- Added missing online help links.
15+
16+
### Removed
17+
18+
- Deleted unused `Types` folder.
19+
320
## v1.1.0
421

522
### Changed

docs/Export-FunctionToFile.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: PSFunctionTools-help.xml
33
Module Name: PSFunctionTools
4-
online version:
4+
online version: https://bit.ly/3mI7E6w
55
schema: 2.0.0
66
---
77

@@ -19,7 +19,7 @@ Export-FunctionToFile [-Name] <String> [-Path <String>] [-PassThru] [-Requires <
1919

2020
## DESCRIPTION
2121

22-
You can use this command to export a function which is loaded into your PowerShell session. You might need to do this when you create an ad-hoc function and want to save it to a file. This command will take the content of the function and export it to a ps1 file. The function name will be used for the file name. Although, characters like the colon will be stripped to create a filesystem-compatibale filename.
22+
You can use this command to export a function which is loaded into your PowerShell session. You might need to do this when you create an ad-hoc function and want to save it to a file. This command will take the content of the function and export it to a ps1 file. The function name will be used for the file name. Although, characters like the colon will be stripped to create a filesystem-compatible filename.
2323

2424
## EXAMPLES
2525

@@ -113,7 +113,7 @@ Accept wildcard characters: False
113113
114114
### -Requires
115115
116-
Specify #Requires statements, including the #
116+
Specify #Requires statements, including the # character.
117117
118118
```yaml
119119
Type: String[]

docs/Format-FunctionName.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ Format a function name to proper case.
1414
## SYNTAX
1515

1616
```yaml
17-
Format-FunctionName [[-Name] <String>] [<CommonParameters>]
17+
Format-FunctionName [-Name] <String> [-NounCapitals <Int32>] [<CommonParameters>]
1818
```
1919

2020
## DESCRIPTION
2121

22-
Format-FunctionName is intended to be used as a helper function in your scripting automation. This is a simple function that will format a verb-noun function name into proper case. It will take an input such as test-data and format it as Test-Data. It will not format as PascalCase. The command also will not verify that the verb component is acceptable. Use Test-FunctionName for that process.
22+
Format-FunctionName is intended to be used as a helper function in your scripting automation. This is a simple function that will format a verb-noun function name into proper case. It will take an input such as test-data and format it as Test-Data. It will not format as Pascal case, although you can capitalize N number of characters in the Noun portion of your command name. The command also will not verify that the verb component is acceptable. Use Test-FunctionName for that process.
2323

2424
## EXAMPLES
2525

@@ -39,7 +39,16 @@ PS C:\> Format-FunctionName try-pssystem
3939
Try-Pssystem
4040
```
4141

42-
The command does not validate the verb nor can it produce a PascalCase result like Try-PsSystem.
42+
The command does not validate the verb nor can it produce a Pascal Case result like Try-PsSystem.
43+
44+
### Example 3
45+
46+
```powershell
47+
PS C:\> Format-FunctionName test-pssystem -NounCapitals 3
48+
Test-PSSystem
49+
```
50+
51+
Even though you can't format in Pascal case, you can specify how many characters of the Noun portion of your command that you want to capitalize.
4352

4453
## PARAMETERS
4554

@@ -55,7 +64,23 @@ Aliases:
5564
Required: True
5665
Position: 0
5766
Default value: None
58-
Accept pipeline input: byValue
67+
Accept pipeline input: True (ByValue)
68+
Accept wildcard characters: False
69+
```
70+
71+
### -NounCapitals
72+
73+
Capitalize the first N number of characters in the Noun.
74+
75+
```yaml
76+
Type: Int32
77+
Parameter Sets: (All)
78+
Aliases:
79+
80+
Required: False
81+
Position: Named
82+
Default value: None
83+
Accept pipeline input: False
5984
Accept wildcard characters: False
6085
```
6186

docs/Get-FunctionAlias.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Get-FunctionAlias [-Path] <String> [<CommonParameters>]
1919

2020
## DESCRIPTION
2121

22-
Get-FunctionAlias is a tool you can use in your scripting automation. It will extract function names and aliases from a PowerShell script file. The source must be a .ps1 or .psm1 file. The command will only idenfity aliases defined as part of the function using code like [alias('foo')].
22+
Get-FunctionAlias is a tool you can use in your scripting automation. It will extract function names and aliases from a PowerShell script file. The source must be a .ps1 or .psm1 file. The command will only identify aliases defined as part of the function using code like [alias('foo')].
2323

2424
## EXAMPLES
2525

docs/Get-FunctionAttribute.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,28 @@ This command can be used to get function attributes such as cmdletbinding or ali
2626
### Example 1
2727

2828
```powershell
29-
PS C:\> Get-Functionattribute -path c:\scripts\Get-ParameterBlock.ps1 -Name get-parameterblock
29+
PS C:\> Get-FunctionAttribute -path c:\scripts\Get-ParameterBlock.ps1 -Name Get-ParameterBlock
3030
3131
3232
Type : cmdletbinding
3333
NamedArguments : {}
3434
PositionalArguments : {}
3535
String : [cmdletbinding()]
36-
Function : Get-Parameterblock
36+
Function : Get-ParameterBlock
3737
Path : C:\scripts\Get-ParameterBlock.ps1
3838
3939
Type : alias
4040
NamedArguments : {}
4141
PositionalArguments : {"gpb"}
4242
String : [alias("gpb")]
43-
Function : Get-Parameterblock
43+
Function : Get-ParameterBlock
4444
Path : C:\scripts\Get-ParameterBlock.ps1
4545
4646
Type : OutputType
4747
NamedArguments : {}
4848
PositionalArguments : {"ParamBlockAst", "String"}
4949
String : [OutputType("ParamBlockAst","String")]
50-
Function : Get-Parameterblock
50+
Function : Get-ParameterBlock
5151
Path : C:\scripts\PSFunctionTools\functions\public\Get-ParameterB
5252
lock.ps1
5353
```

docs/Get-FunctionName.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Get-FunctionName [-Path] <String> [-All] [-Detailed] [<CommonParameters>]
1919

2020
## DESCRIPTION
2121

22-
When exporting functions from files, you may only want to export specific functions. Which you can do if you know the name. Use Get-FunctionName to identify the names of functions. The default behavior is to get names of functions that follow the verb-noun naming convention.
22+
When exporting functions from files, you may only want to export specific functions. Which you can do if you know the name. Use Get-FunctionName to identify the names of functions. The default behavior is to get names of functions that follow the Verb-Noun naming convention.
2323

2424
## EXAMPLES
2525

@@ -129,6 +129,7 @@ Accept wildcard characters: False
129129
```
130130
131131
### CommonParameters
132+
132133
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).
133134
134135
## INPUTS

docs/Get-ModuleLayout.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Get-ModuleLayout [-Path] <String> [-AsTree] [<CommonParameters>]
1919

2020
## DESCRIPTION
2121

22-
This command will provide information about a module layout folder which was created using Export-ModuleLayout. The default output is custom object. You can elect to view the layout as a tree. This parameter requires the tree commandline utility which should be available on Windows systems by default. On non-Windows platforms, you may need to install the utility.
22+
This command will provide information about a module layout folder which was created using Export-ModuleLayout. The default output is custom object. You can elect to view the layout as a tree. This parameter requires the tree command-line utility which should be available on Windows systems by default. On non-Windows platforms, you may need to install the utility.
2323

2424
## EXAMPLES
2525

0 commit comments

Comments
 (0)