File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ ValidatePlatform
3+ ----------------
4+ ### Synopsis
5+ Validates the Platform
6+
7+ ---
8+ ### Description
9+
10+ Validates the Platform.
11+
12+ When used within Parameters, this adds a ``` [ValidateScript({})] ``` to ensure that the platform is correct.
13+
14+ When used on a ``` [Management.Automation.Language.VariableExpressionAst] ``` will apply a
15+ ``` [ValidateScript({})] ``` to that variable, which will prevent assignemnt to the variable if not on the platform.
16+
17+ ---
18+ ### Examples
19+ #### EXAMPLE 1
20+ ``` PowerShell
21+ {
22+ param(
23+ [ValidatePlatform("Windows")]
24+ [switch]
25+ $UseWMI
26+ )
27+ } | .>PipeScript
28+ ```
29+
30+ ---
31+ ### Parameters
32+ #### ** Platform**
33+
34+ The name of one or more platforms. These will be interpreted as wildcards.
35+
36+
37+
38+ | Type | Requried| Postion| PipelineInput|
39+ | ----------------| --------| -------| -------------|
40+ | ``` [String[]] ``` | true | 1 | false |
41+ ---
42+ #### ** VariableAST**
43+
44+ | Type | Requried| Postion| PipelineInput |
45+ | -----------------------------| --------| -------| --------------|
46+ | ``` [VariableExpressionAst] ``` | false | named | true (ByValue)|
47+ ---
48+ ### Syntax
49+ ``` PowerShell
50+ ValidatePlatform [-Platform] <String[]> [<CommonParameters>]
51+ ```
52+ ``` PowerShell
53+ ValidatePlatform [-Platform] <String[]> [-VariableAST <VariableExpressionAst>] [<CommonParameters>]
54+ ```
55+ ---
56+
57+
You can’t perform that action at this time.
0 commit comments