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

24 Comments

  1. Please let me know if you’re looking for a writer for your blog. You have some really good articles and I feel I would be a good asset. If you ever want to take some of the load off, I’d love to write some material for your blog in exchange for a link back to mine. Please shoot me an e-mail if interested. Cheers!

  2. Youre so cool! I dont suppose Ive learn anything like this before. So good to search out someone with some unique thoughts on this subject. realy thank you for beginning this up. this website is one thing that’s needed on the internet, someone with a bit originality. helpful job for bringing one thing new to the internet!

  3. Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back frequently!

  4. Hi there! This post couldn’t be written any better! Reading through this post reminds me of my previous room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thank you for sharing!

Leave a Reply

Your email address will not be published.