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

2 Comments

  1. Thank you so much for giving everyone remarkably brilliant chance to read from here. It is often so excellent plus stuffed with a lot of fun for me and my office acquaintances to search your website at least three times a week to read through the new items you have got. Of course, I am certainly amazed concerning the cool secrets you serve. Some 1 facts in this posting are completely the most efficient I’ve had.

Leave a Reply

Your email address will not be published.