From a0b3744a6818321026309e9d2707fb18a98ad618 Mon Sep 17 00:00:00 2001 From: Sam Erde Date: Tue, 29 Oct 2024 11:07:19 -0400 Subject: [PATCH] Update help. Remove GridView parameter. --- .../Public/Get-TypeAccelerator.ps1 | 38 +++++-------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/src/PSPreworkout/Public/Get-TypeAccelerator.ps1 b/src/PSPreworkout/Public/Get-TypeAccelerator.ps1 index 485a063..f1d9438 100644 --- a/src/PSPreworkout/Public/Get-TypeAccelerator.ps1 +++ b/src/PSPreworkout/Public/Get-TypeAccelerator.ps1 @@ -9,19 +9,23 @@ function Get-TypeAccelerator { .PARAMETER Name The name of a specific type accelerator to get. - .PARAMETER GridView - Show the output in a grid view. - .EXAMPLE Get-TypeAccelerator -Name ADSI + .EXAMPLE + Get-TypeAccelerator -Name ps* + + Get all type accelerators that begin with the string "ps". + .NOTES Author: Sam Erde - Version: 0.0.2 - Modified: 2024/10/12 + Version: 0.0.3 + Modified: 2024/10/29 Thanks to Jeff Hicks (@JDHITSolutions) for helpful suggestions and improvements on this output! + Change Log: Removed the grid view option to allow user flexibility in how they want to output the results. + #> [CmdletBinding(HelpUri = 'https://day3bits.com/PSPreworkout/Get-TypeAccelerator')] [OutputType('System.Array')] @@ -32,12 +36,7 @@ function Get-TypeAccelerator { [Parameter(Position = 0, HelpMessage = 'The name of the type accelerator, such as "ADSI."')] [SupportsWildcards()] [string] - $Name = '*', - - # Show a grid view of the loaded assemblies - [Parameter()] - [switch] - $GridView + $Name = '*' ) $TypeAccelerators = ([PSObject].Assembly.GetType('System.Management.Automation.TypeAccelerators')::Get).GetEnumerator() | @@ -51,22 +50,5 @@ function Get-TypeAccelerator { Type = $_.Value.FullName } } - - if ($PSBoundParameters.ContainsKey('GridView')) { - - if ((Get-Command -Name Out-ConsoleGridView -ErrorAction SilentlyContinue) -and ($PSVersionTable.PSEdition -eq 'Core')) { - - $TypeAccelerators | Out-ConsoleGridView -OutputMode Multiple - - } elseif ((Get-Command -Name Out-GridView -ErrorAction SilentlyContinue) -and ($PSVersionTable.PSEdition -eq 'Desktop')) { - - $TypeAccelerators | Out-GridView -OutputMode Multiple - - } else { - Write-Output 'The Out-GridView and Out-ConsoleGridView cmdlets were not found. Please install the Microsoft.PowerShell.ConsoleGuiTools module or re-install the PowerShell ISE if using Windows PowerShell 5.1.' - $TypeAccelerators | Format-Table -AutoSize - } - } - $TypeAccelerators }