-
Notifications
You must be signed in to change notification settings - Fork 1
/
Get-VersionParameter.ps1
64 lines (52 loc) · 1.46 KB
/
Get-VersionParameter.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<#
.SYNOPSIS
A brief description of the file.
.DESCRIPTION
A description of the file.
.PARAMETER ExcludeCmd
A description of the ExcludeCmd parameter.
.PARAMETER ExcludeParameter
A description of the ExcludeParameter parameter.
.PARAMETER Command
A description of the Command parameter.
.PARAMETER Exclude
A description of the Exclude parameter.
.PARAMETER Cmdlet
A description of the Cmdlet parameter.
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2015 v4.2.99
Created on: 1/7/2016 4:47 PM
Created by: June Blender
Organization: SAPIEN Technologies, Inc
Filename:
===========================================================================
#>
param
(
[string[]]
$CommandName,
[string[]]
$ExcludeCmd = ('Get-Process', 'New-WinEvent'),
[string[]]
$ExcludeParameter = ('ClrVersion', 'DotNetVersion', 'DotNetFrameworkVersion', 'SchemaVersion')
)
Import-Module PowerShellGet
if ($CommandName)
{
$commands = Get-Command $CommandName
}
else
{
$commands = Get-Command | where { $_.Name -notin $ExcludeCmd }
}
foreach ($cmd in $commands)
{
if ($parm = $cmd.ParameterSets.Parameters.Name | where { ($_ -like "*version*") -and $_ -notin $ExcludeParameter } | Sort -Unique)
{
foreach ($p in $parm)
{
[PSCustomObject]@{ 'Command' = $cmd.Name; 'Module' = $cmd.ModuleName; 'Version' = $cmd.Version; 'Parameter' = $p }
}
}
}