
Very interesting article found in the Technet Blog
To use the functions contained in the include.ps1 script, you can (…) dot-source the script. This is seen in the useInclude.ps1 script.
. "c:\fso\include.ps1" addone -intIn 3 addTwo -intIn 3
When the script runs, both functions are available to the script, and can be called directly from the body of the script as if they had been copied and pasted into the script. The two functions from the Include.ps1 script are not on the function drive prior to execution of the UseInclude.ps1 script. After the script completes, they still are not on the function drive. The only way to have access to the functions inside the Windows PowerShell console is to dot-source them directly into the Windows PowerShell console
My Powershell script categories
- Active Directory
- Cluster
- Database
- Exchange
- Files and folders
- Hardware
- Network
- Operating System
- PKI
- SCCM
- Service and process
- Tips
- VMWare
References
Reuse a Powershell function
To get further you can also dot source a common profile to provide a custo m environment inside a team, take a look at http://stackoverflow.com/a/4449085/381149
Great. Thank you for the link
To get further you can also dot source a common profile to provide a custo m environment inside a team, take a look at http://stackoverflow.com/a/4449085/381149
Great. Thank you for the link