Skip to content

Commit 5a0d531

Browse files
StartAutomatingStartAutomating
authored andcommitted
Updating PipeScript.HelpOut.ps1 (#56)
1 parent 98bccd7 commit 5a0d531

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

docs/ValidatePlatform.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+

0 commit comments

Comments
 (0)