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

28 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!

  5. Can I just say what a reduction to search out someone who actually knows what theyre talking about on the internet. You positively know easy methods to convey an issue to light and make it important. More folks have to learn this and perceive this aspect of the story. I cant imagine youre no more widespread since you positively have the gift.

  6. Hey there just wanted to give you a quick heads up. The words in your article seem to be running off the screen in Internet explorer. I’m not sure if this is a format issue or something to do with web browser compatibility but I thought I’d post to let you know. The design and style look great though! Hope you get the problem fixed soon. Kudos

Leave a Reply

Your email address will not be published.