if ($PSBoundParameters.Count -eq 0) { Get-Help $MyInvocation.MyCommand.Name return }
Previous answers use $MyInvocation.MyCommand.Definition and it doesn't work for me
$MyInvocation.MyCommand.Definition