Modularization Tricks


While it's useful to have script blocks, functions, and filters available for copying and pasting between scripts, you can also make them a persistent part of your global shell environment by adding them to your profile. For example, if you've created a function that performs some useful task that you're calling on again and again, simply add the function into your profile to make it available as soon as PowerShell starts. In fact, Microsoft uses this trick. The PowerShell Help command is actually a function that is predefined in the default profile that ships with PowerShell. To add a function to your profile, just open your profile, which is a text file, and paste the function into your profile.



Windows PowerShell. TFM
Internet Forensics
ISBN: 982131445
EAN: 2147483647
Year: 2004
Pages: 289

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net