Skip to content

Instantly share code, notes, and snippets.

@alx9r
Created March 20, 2018 15:23
Show Gist options
  • Select an option

  • Save alx9r/4773628b99ef3066cafd409b10469bf9 to your computer and use it in GitHub Desktop.

Select an option

Save alx9r/4773628b99ef3066cafd409b10469bf9 to your computer and use it in GitHub Desktop.
search code snippet mentioned in PowerShell/PowerShell#6419
Get-Module -ListAvailable |
? {$_.Path -like '*System32*' } |
% { Get-Command -Module $_ } |
% {
$command = $_
[pscustomobject]@{
Command = $command
MOdule = $command.Module
Parameter = $command |
% {
$_.Module | Import-Module -ErrorAction SilentlyContinue
try
{
[System.Management.Automation.CommandMetadata]::new($_)
}
catch {}
} |
% {$_.Parameters.Values} |
? {
($_.ParameterType -in [object],[object[]]) -and
($_.Attributes.ValueFromPipeline -or $_.Attributes.ValueFromPipelineByPropertyName)
} |
% Name
}
} |
? { $_.Parameter }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment