Skip to content

Instantly share code, notes, and snippets.

@rakheshster
Last active June 2, 2020 20:00
Show Gist options
  • Save rakheshster/a76c6d58f2f781ef4a641b9fbbc2626c to your computer and use it in GitHub Desktop.
Save rakheshster/a76c6d58f2f781ef4a641b9fbbc2626c to your computer and use it in GitHub Desktop.
Get parameters of a PowerShell Cmdlet
function Get-Parameters {
param ($cmdlet)
if (Get-Command $cmdlet -ErrorAction SilentlyContinue) {
Get-Help -Name $cmdlet -Full | Select-Object -expandProperty Parameters | Select-Object -ExpandProperty Parameter | select -Property Name,PipelineInput
} else {
Write-Error "$cmdlet not found" -ErrorAction Stop
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment