Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a powershell script that has a bunch of powershell functions. I want to be able to selectivly call indiviual functions from my application without running the whole script.

My research into calling Powershell code from has shown me either to call in individual powershell COMMAND (say Get-User) or calling a complete powershell script itself (The whole .ps1 file)

Anyone know how to do this, or can point me to a good site (that has code examples?)


share|improve this question
Since functions are script blocks, or basically mini-scripts, have you thought about breaking them out into separate .ps1 files and calling them that way? – Christopher Feb 14 '12 at 20:39

Microsoft's new scripting shell formerly known as Monad or MSH. For examples you could visit here.

share|improve this answer
Is that your personal site? – Bart De Vos May 2 '12 at 11:59
Not mine, but a very useful site and I found it could help to deal with the situation. – Cylian May 2 '12 at 12:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.