![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Scripts and Preprocessor Directives I stumbled across this feature by accident recently, when commenting a particular script. As some of you may already be aware, you can insert a '#requires' statement into a script, for example #requires -pssnapin MyCmdletsPSSnapIn which ensures that a particular required snapin is available, and #requires -version 1 specifies that a particular version of PowerShell is required. Which kinda begs the question... Are there any other such 'directives', and if so, are they documented (or discoverable) anywhere? (NB I've used the term 'Preprocessor Directive', but there may well be a better term for describing them). Any thoughts or insights appreciated. Thanks. -- Jon |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | Re: Scripts and Preprocessor Directives The "#requires" statement must be in one of the following formats: #requires -shellid <shellID> #requires -version <major.minor> #requires -pssnapin <psSnapInName> [-version <major.minor>] HTH ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic
| ||||||||||||
My System Specs![]() | |||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Scripts and Preprocessor Directives | Jon | PowerShell | 2 | 01-01-2008 02:39 PM |
| PS scripts -> VBS | PowerShell | 2 | 09-22-2007 05:14 PM | |
| scripts | Juan | Vista General | 2 | 09-18-2007 07:21 AM |
| UAC and scripts | MJ | Vista General | 0 | 08-02-2007 03:22 PM |
| run different scripts | frank | PowerShell | 7 | 03-07-2007 03:47 PM |