Skip to content

Commit 2e6e626

Browse files
v2.50.0
1 parent 9f97ccd commit 2e6e626

28 files changed

+1058
-626
lines changed

PSScriptToolData.json

Lines changed: 730 additions & 0 deletions
Large diffs are not rendered by default.

PSScriptTools.psd1

-138 Bytes
Binary file not shown.

PSScriptTools.psm1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ $global:PSSpecialChar = @{
9191
Write-Verbose "Defining the variable `$PSSamplePath to the samples folder for this module"
9292
$global:PSSamplePath = Join-Path -Path $PSScriptRoot -ChildPath Samples
9393

94+
#define a private variable with PSScriptTools data
95+
$ToolDataPath = "$PSScriptRoot\PSScriptToolData.json"
96+
9497
#region editor integrations
9598
Write-Verbose 'Add ToDo options to the ISE or VS Code'
9699
if ($psEditor) {

PSScriptToolsManual.pdf

-120 KB
Binary file not shown.

README.md

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,19 +1563,6 @@ Get-Service | Out-More
15631563

15641564
This also works in PowerShell 7.
15651565

1566-
### [Out-ConditionalColor](docs/Out-ConditionalColor.md)
1567-
1568-
__This command is marked as deprecated and will be removed in a future release.__
1569-
1570-
This command is designed to take pipeline input and display it in a colorized format, based on a set of conditions. Unlike `Write-Host`, which doesn't write to the pipeline, this command will write output to the pipeline. You can use a simple hashtable to define a color if the given property matches the hashtable key.
1571-
1572-
![Out-ConditionalColor-1](images/occ-1.png)
1573-
1574-
Or you can specify an ordered hashtable for more complex processing.
1575-
![Out-ConditionalColor-2](images/occ-2.png)
1576-
1577-
This command doesn't always work depending on the type of object you pipe to it. The problem appears to be related to the formatting system. Development and testing are ongoing.
1578-
15791566
### [Set-ConsoleTitle](docs/Set-ConsoleTitle.md)
15801567

15811568
Set the title bar of the current PowerShell console window.
@@ -1586,16 +1573,6 @@ if (Test-IsAdministrator) {
15861573
}
15871574
```
15881575

1589-
### [Set-ConsoleColor](docs/Set-ConsoleColor.md)
1590-
1591-
__This command is marked as deprecated and will be removed in a future release.__
1592-
1593-
Configure the foreground or background color of the current PowerShell console window. Note that if you are running the PSReadLine module, this command won't work. You should use `Set-PSReadLineOption` or a similar command to configure your session settings.
1594-
1595-
```powershell
1596-
Set-ConsoleColor -background DarkGray -foreground Yellow
1597-
```
1598-
15991576
### [Add-Border](docs/Add-Border.md)
16001577

16011578
This command will create a character or text-based border around a line of text. You might use this to create a formatted text report or to improve the display of information on the screen.
@@ -1910,7 +1887,7 @@ Rabbit Popcorn Green
19101887
Rabbit Pretzels Green
19111888
```
19121889

1913-
The duplicate items have been removed. This command works best with simple objects. If your objects have nested object properties, you will need to test if this command can properly filter for unique items.
1890+
The duplicate items have been removed. This command works best with simple objects. If your objects have nested object properties, you will need to test if this command can properly filter for unique items. For more complex objects, you should use the `Property` parameter.
19141891

19151892
### [Test-IsElevated](docs/Test-IsElevated.md)
19161893

@@ -2473,7 +2450,7 @@ PS C:\> Get-CimMember -ClassName win32_Volume -Property q*
24732450
QuotasRebuilding Boolean ReadOnly, NullValue
24742451
```
24752452

2476-
### Get-CimClassPropertyQualifier](docs/Get-CimClassPropertyQualifier.md)
2453+
### [Get-CimClassPropertyQualifier](docs/Get-CimClassPropertyQualifier.md)
24772454

24782455
This command is an alternative to Get-CimClass to make it easier to get information about property qualifiers of a WMI/CIM class.
24792456

@@ -2654,7 +2631,7 @@ $sb = {
26542631
$i++
26552632
$pct = [math]::round($i/$top.count,2)
26562633
Write-ANSIProgress -PercentComplete $pct -position $pos
2657-
Write-Host " Processing $(($item.FullName).padright(80))"
2634+
Write-Host " Processing $(($item.FullName).PadRight(80))"
26582635
-ForegroundColor Yellow -NoNewline
26592636
$out+= Get-ChildItem -Path $item -Recurse -file |
26602637
Measure-Object -property length -sum |
@@ -2837,7 +2814,7 @@ I've created a PDF version of this document which I thought you might find usefu
28372814

28382815
## Deprecated Commands
28392816

2840-
The following commands have been marked as deprecated and will be removed in a future release.
2817+
The following commands have been removed as of v2.50.0.
28412818

28422819
+ [Set-ConsoleColor](docs/Set-ConsoleColor.md)
28432820
+ [Out-ConditionalColor](docs/Out-ConditionalColor.md)
File renamed without changes.
File renamed without changes.

changelog.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,46 @@ This file contains the most recent change history for the PSScriptTools module.
44

55
## [Unreleased]
66

7+
## [2.50.0] - 2024-07-13
8+
9+
### Added
10+
11+
- Added an argument completer for the `Name` parameter of `Show-FunctionItem`.
12+
- Added a new `Property` parameter to `Get-PSUnique` to allow the user to specify a property or properties to use for comparison. The command will also display a warning if a comparison can't be made. [Issue #150](https://github.com/jdhitsolutions/PSScriptTools/issues/150)
13+
14+
### Changed
15+
16+
- Ongoing and general code cleanup.
17+
- Removed previously deprecated commands `Set-ConsoleColor` and `Out-ConditionalColor`.
18+
- Changed `Get-PSScriptTools to use saved data from a JSON file instead of building the data from `Get-Command`, `Get-Alias`, and `Get-Help`. This also fixes display problems with the Synopsis property in Linux.
19+
- Changed `Write-ANSIProgress` by adding a parameter to write to the host and not the pipeline.
20+
- Updated `README`.
21+
22+
### Fixed
23+
24+
- Removed obsolete comment-based help for `New-PSDynamicParameter`.
25+
726
## [2.49.0] - 2024-06-06
827

928
### Added
1029

11-
- Modified `ConvertTo-Markdown` to use `Property`and `Value` headings when converting to a list.
12-
- Added CimMember functions `Get-CimNamespace`,`Get-CimClassMethod`, `Get-CimClassProperty`,`Get-CimClassPropertyQualifier`, `Get-CimClassName` and `Get-CimMember`. ([Issue #137](https://github.com/jdhitsolutions/PSScriptTools/issues/137))
30+
- Modified `ConvertTo-Markdown` to use `Property` and `Value` headings when converting to a list.
31+
- Added CimMember functions `Get-CimNamespace`, `Get-CimClassMethod`, `Get-CimClassProperty`, `Get-CimClassPropertyQualifier`, `Get-CimClassName` and `Get-CimMember`. ([Issue #137](https://github.com/jdhitsolutions/PSScriptTools/issues/137))
1332
- Added custom formatting for `Get-CimClassName`.
1433
- Added the module `ThreadJob` as a module dependency to the manifest.
1534

1635
### Changed
1736

1837
- Modified module manifest to remove version logic on function export. Now exporting everything. If there is an OS limitation, try to handle it on a per-command basis. **This may be a breaking change**.
1938
- Changed PDF manual theme from `github` to `github.dark`.
20-
- Changed PDF manual theme from `github` to `github.dark`.
2139
- Updated `Get-ParameterInfo` to recognize `ProgressAction` as a common parameter. This parameter was add in PowerShell 7.
2240
- Updated the default table view for output from `Get-ModuleCommand` to include the module version number.
2341
- Modified `Show-Tree` to better handle multi-string and binary values in the registry.
2442
- Modified `Show-Tree` to use `PSStyle.FileInfo` for color information if detected. ([Issue #147](https://github.com/jdhitsolutions/PSScriptTools/issues/147))
2543
- Updated `README.md`
2644
- Revised `Get-FolderSizeInfo` to be more consistent between PowerShell versions. The command will skip counting all reparse points. **This may be a breaking change**. ([Issue #145](https://github.com/jdhitsolutions/PSScriptTools/issues/145))
2745
- Re-wrote `Find-CimClass` to use `CimSession`.
28-
- Revised `Get-ParameterInfo` to sort output by default using ParameterSet,Position, and Name
46+
- Revised `Get-ParameterInfo` to sort the output by default using ParameterSet, Position, and Name
2947
- Help updates.
3048

3149
### Fixed
@@ -37,7 +55,7 @@ This file contains the most recent change history for the PSScriptTools module.
3755

3856
### Added
3957

40-
- Added parameter `ProviderName` to `Get-CommandSyntax to let the user specify a provider.`[Issue #139](https://github.com/jdhitsolutions/PSScriptTools/issues/139)
58+
- Added parameter `ProviderName` to `Get-CommandSyntax to let the user specify a provider.` [Issue #139](https://github.com/jdhitsolutions/PSScriptTools/issues/139)
4159

4260
### Changed
4361

@@ -110,7 +128,8 @@ This file contains the most recent change history for the PSScriptTools module.
110128

111129
If you need to see older change history, look at the [Archive ChangeLog](https://github.com/jdhitsolutions/PSScriptTools/blob/master/Archive-ChangeLog.md) online.
112130

113-
[Unreleased]: https://github.com/jdhitsolutions/PSScriptTools/compare/v2.49.0..HEAD
131+
[Unreleased]: https://github.com/jdhitsolutions/PSScriptTools/compare/v2.50.0..HEAD
132+
[2.50.0]: https://github.com/jdhitsolutions/PSScriptTools/compare/v2.49.0..v2.50.0
114133
[2.49.0]: https://github.com/jdhitsolutions/PSScriptTools/compare/v2.48.0..v2.49.0
115134
[v2.48.0]: https://github.com/jdhitsolutions/PSScriptTools/compare/v2.47.0..v2.48.0
116135
[v2.47.0]: https://github.com/jdhitsolutions/PSScriptTools/compare/v2.46.0..v2.47.0

docs/Get-CimMember.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ schema: 2.0.0
99

1010
## SYNOPSIS
1111

12-
Get information about CIM class members
12+
Get information about CIM class members.
1313

1414
## SYNTAX
1515

docs/Get-CimNamespace.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ schema: 2.0.0
99

1010
## SYNOPSIS
1111

12-
Enumerate WMI/CIM namespaces
12+
Enumerate WMI/CIM namespaces.
1313

1414
## SYNTAX
1515

docs/Get-PSAnsiFileMap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ schema: 2.0.0
99

1010
## SYNOPSIS
1111

12-
Display the PSAnsiFileMap
12+
Display the PSAnsiFileMap.
1313

1414
## SYNTAX
1515

docs/Get-PSProfile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ schema: 2.0.0
99

1010
## SYNOPSIS
1111

12-
Get PowerShell profile locations
12+
Get PowerShell profile locations.
1313

1414
## SYNTAX
1515

docs/Get-PSSessionInfo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ schema: 2.0.0
99

1010
## SYNOPSIS
1111

12-
Get details about the current PowerShell session
12+
Get details about the current PowerShell session.
1313

1414
## SYNTAX
1515

docs/Get-PSUnique.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ Filter for unique objects.
1313

1414
## SYNTAX
1515

16-
```yaml
17-
Get-PSUnique [-InputObject] <Object> [<CommonParameters>]
16+
```
17+
Get-PSUnique [-InputObject] <Object> [-Property <String[]>] [<CommonParameters>]
1818
```
1919

2020
## DESCRIPTION
2121

2222
You can use this command to filter for truly unique objects. That is, every property on every object is considered unique. Most things in PowerShell are already guaranteed to be unique, but you might import data from a CSV file with duplicate entries. Get-PSUnique can help filter.
2323

24-
This command works best with simple objects. Objects with nested objects as properties may not be properly detected.
24+
This command works best with simple objects. Objects with nested objects as properties may not be properly detected. For complex objects, you might need to specify the property or properties to use for comparison.
2525

2626
## EXAMPLES
2727

@@ -51,6 +51,22 @@ Accept pipeline input: True (ByValue)
5151
Accept wildcard characters: False
5252
```
5353
54+
### -Property
55+
56+
Specify a property to use for the comparison.
57+
58+
```yaml
59+
Type: String[]
60+
Parameter Sets: (All)
61+
Aliases:
62+
63+
Required: False
64+
Position: Named
65+
Default value: None
66+
Accept pipeline input: False
67+
Accept wildcard characters: False
68+
```
69+
5470
### CommonParameters
5571
5672
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).

docs/New-FunctionItem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ schema: 2.0.0
99

1010
## SYNOPSIS
1111

12-
Create a function item from the console
12+
Create a function item from the console.
1313

1414
## SYNTAX
1515

docs/New-PSDynamicParameter.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ schema: 2.0.0
99

1010
## SYNOPSIS
1111

12-
Create a PowerShell dynamic parameter.
12+
Create a PowerShell function dynamic parameter.
1313

1414
## SYNTAX
1515

1616
```yaml
17-
New-PSDynamicParameter [-ParameterName] <String[]> -Condition <String> [-Mandatory] [-DefaultValue <Object[]>] [-Alias <String[]>]
18-
[-ParameterType <Type>] [-HelpMessage <String>][-ValueFromPipelineByPropertyName] [-ParameterSetName <String>]
19-
[-Comment <String>] [-ValidateNotNullOrEmpty] [-ValidateLength <Int32[]>]
20-
[-ValidateSet <Object[]>] [-ValidateRange <Int32[]>] [-ValidateCount <Int32[]>] [-ValidatePattern <String>] [-ValidateScript <ScriptBlock>] [<CommonParameters>]
17+
New-PSDynamicParameter [-ParameterName] <String[]> -Condition <String> [-Mandatory]
18+
[-DefaultValue <Object[]>] [-Alias <String[]>] [-ParameterType <Type>] [-HelpMessage <String>][-ValueFromPipelineByPropertyName] [-ParameterSetName <String>][-Comment <String>] [-ValidateNotNullOrEmpty] [-ValidateLength <Int32[]>] [-ValidateSet <Object[]>]
19+
[-ValidateRange <Int32[]>] [-ValidateCount <Int32[]>] [-ValidatePattern <String>] [-ValidateScript <ScriptBlock>] [<CommonParameters>]
2120
```
2221

2322
## DESCRIPTION

docs/Set-LocationToCurrent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ schema: 2.0.0
99

1010
## SYNOPSIS
1111

12-
Change script editor terminal location.
12+
Change your script editor terminal location. Only valid in VSCode or the ISE.
1313

1414
## SYNTAX
1515

docs/Set-PSAnsiFileMap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ schema: 2.0.0
99

1010
## SYNOPSIS
1111

12-
Modify or add a PSAnsiFileEntry
12+
Modify or add a PSAnsiFileEntry.
1313

1414
## SYNTAX
1515

docs/Show-ANSISequence.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ schema: 2.0.0
99

1010
## SYNOPSIS
1111

12-
Display ANSI escape sequences
12+
Display ANSI escape sequences.
1313

1414
## SYNTAX
1515

0 commit comments

Comments
 (0)