1
1
Requires
2
2
--------
3
+
4
+
5
+
6
+
3
7
### Synopsis
4
8
requires one or more modules, variables, or types.
5
9
10
+
11
+
6
12
---
13
+
14
+
7
15
### Description
8
16
9
17
Requires will require on or more modules, variables, or types to exist.
10
18
19
+
20
+
11
21
---
22
+
23
+
12
24
### Examples
13
25
#### EXAMPLE 1
14
26
``` PowerShell
@@ -20,170 +32,160 @@ requires latest pipescript # will require the latest version of pipescript
20
32
requires variable $pid $sid # will error, because there is no $sid
21
33
```
22
34
35
+
36
+
23
37
---
38
+
39
+
24
40
### Parameters
25
41
#### ** Module**
26
42
27
43
One or more required modules.
28
44
29
45
30
46
31
- > ** Type** : ``` [Object] ```
32
47
33
- > ** Required** : false
34
48
35
- > ** Position** : named
36
49
37
- > ** PipelineInput** : true (ByPropertyName)
50
+ | Type | Required| Position| PipelineInput |
51
+ | ----------| --------| --------| ---------------------|
52
+ | ` [Object] ` | false | named | true (ByPropertyName)|
38
53
39
54
40
55
41
- ---
42
56
#### ** Latest**
43
57
44
58
If set, will require the latest version of a module.
45
59
46
60
47
61
48
- > ** Type** : ``` [Switch] ```
49
62
50
- > ** Required** : false
51
63
52
- > ** Position** : named
53
64
54
- > ** PipelineInput** : true (ByPropertyName)
65
+ | Type | Required| Position| PipelineInput |
66
+ | ----------| --------| --------| ---------------------|
67
+ | ` [Switch] ` | false | named | true (ByPropertyName)|
55
68
56
69
57
70
58
- ---
59
71
#### ** ModuleLoader**
60
72
61
73
A ModuleLoader script can be used to dynamically load unresolved modules.
62
74
This script will be passed the unloaded module as an argument, and should return a module.
63
75
64
76
65
77
66
- > ** Type** : ``` [ScriptBlock] ```
67
78
68
- > ** Required** : false
69
79
70
- > ** Position** : named
71
80
72
- > ** PipelineInput** : true (ByPropertyName)
81
+ | Type | Required| Position| PipelineInput | Aliases |
82
+ | ---------------| --------| --------| ---------------------| ----------------------------------------------------|
83
+ | ` [ScriptBlock] ` | false | named | true (ByPropertyName)| ModuleResolver<br />Module Loader<br />Module Resolver|
73
84
74
85
75
86
76
- ---
77
87
#### ** Type**
78
88
79
89
One or more required types.
80
90
81
91
82
92
83
- > ** Type** : ``` [Object] ```
84
93
85
- > ** Required** : false
86
94
87
- > ** Position** : named
88
95
89
- > ** PipelineInput** : true (ByPropertyName)
96
+ | Type | Required| Position| PipelineInput |
97
+ | ----------| --------| --------| ---------------------|
98
+ | ` [Object] ` | false | named | true (ByPropertyName)|
90
99
91
100
92
101
93
- ---
94
102
#### ** TypeLoader**
95
103
96
104
A TypeLoader script can be used to dynamically load unresolved types.
97
105
This script will be passed the unloaded type as an argument.
98
106
99
107
100
108
101
- > ** Type** : ``` [ScriptBlock] ```
102
109
103
- > ** Required** : false
104
110
105
- > ** Position** : named
106
111
107
- > ** PipelineInput** : true (ByPropertyName)
112
+ | Type | Required| Position| PipelineInput | Aliases |
113
+ | ---------------| --------| --------| ---------------------| ----------------------------------------------|
114
+ | ` [ScriptBlock] ` | false | named | true (ByPropertyName)| TypeResolver<br />Type Loader<br />Type Resolver|
108
115
109
116
110
117
111
- ---
112
118
#### ** Variables**
113
119
114
120
One or more required variables.
115
121
116
122
117
123
118
- > ** Type** : ``` [Object] ```
119
124
120
- > ** Required** : false
121
125
122
- > ** Position** : named
123
126
124
- > ** PipelineInput** : true (ByPropertyName)
127
+ | Type | Required| Position| PipelineInput | Aliases |
128
+ | ----------| --------| --------| ---------------------| --------|
129
+ | ` [Object] ` | false | named | true (ByPropertyName)| Variable|
125
130
126
131
127
132
128
- ---
129
133
#### ** VariableLoader**
130
134
131
135
A VariableLoader script can be used to dynamically load unresolved variable.
132
136
This script will be passed the unloaded variable as an argument.
133
137
134
138
135
139
136
- > ** Type** : ``` [ScriptBlock] ```
137
140
138
- > ** Required** : false
139
141
140
- > ** Position** : named
141
142
142
- > ** PipelineInput** : true (ByPropertyName)
143
+ | Type | Required| Position| PipelineInput | Aliases |
144
+ | ---------------| --------| --------| ---------------------| ----------------------------------------------------------|
145
+ | ` [ScriptBlock] ` | false | named | true (ByPropertyName)| VariableResolver<br />Variable Loader<br />Variable Resolver|
143
146
144
147
145
148
146
- ---
147
149
#### ** CommandAst**
148
150
149
151
The Command AST. This will be provided when using the transpiler as a keyword.
150
152
151
153
152
154
153
- > ** Type** : ``` [CommandAst] ```
154
155
155
- > ** Required** : true
156
156
157
- > ** Position** : named
158
157
159
- > ** PipelineInput** : true (ByValue)
158
+ | Type | Required| Position| PipelineInput |
159
+ | --------------| --------| --------| --------------|
160
+ | ` [CommandAst] ` | true | named | true (ByValue)|
160
161
161
162
162
163
163
- ---
164
164
#### ** ScriptBlock**
165
165
166
166
The ScriptBlock. This will be provided when using the transpiler as an attribute.
167
167
168
168
169
169
170
- > ** Type** : ``` [ScriptBlock] ```
171
170
172
- > ** Required** : true
173
171
174
- > ** Position** : named
175
172
176
- > ** PipelineInput** : true (ByValue)
173
+ | Type | Required| Position| PipelineInput |
174
+ | ---------------| --------| --------| --------------|
175
+ | ` [ScriptBlock] ` | true | named | true (ByValue)|
176
+
177
+
177
178
178
179
179
180
180
181
---
182
+
183
+
181
184
### Syntax
182
185
``` PowerShell
183
186
Requires [-Module <Object>] [-Latest] [-ModuleLoader <ScriptBlock>] [-Type <Object>] [-TypeLoader <ScriptBlock>] [-Variables <Object>] [-VariableLoader <ScriptBlock>] -CommandAst <CommandAst> [<CommonParameters>]
184
187
```
185
188
``` PowerShell
186
189
Requires [-Module <Object>] [-Latest] [-ModuleLoader <ScriptBlock>] [-Type <Object>] [-TypeLoader <ScriptBlock>] [-Variables <Object>] [-VariableLoader <ScriptBlock>] -ScriptBlock <ScriptBlock> [<CommonParameters>]
187
190
```
188
- ---
189
191
0 commit comments