Home » Powershell » How to display function definition / code in powershell

How to display function definition / code in powershell

If the function name contains a hyphen (eg. test-computername):

${function:test-Computername}

Alternatively:

(Get-Command test-Computername).Definition

Or

cat function:show-list

To export function to text file

cat function:test-computername >c:\temp\function

Leave a Reply

Your email address will not be published. Required fields are marked *

Name *
Email *
Website