File tree Expand file tree Collapse file tree 1 file changed +102
-0
lines changed
Expand file tree Collapse file tree 1 file changed +102
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ Http.Protocol
3+ -------------
4+ ### Synopsis
5+ http protocol
6+
7+ ---
8+ ### Description
9+
10+ Converts an http[ s] protocol command to PowerShell.
11+
12+ ---
13+ ### Examples
14+ #### EXAMPLE 1
15+ ``` PowerShell
16+ {
17+ https://api.github.com/repos/StartAutomating/PipeScript
18+ }
19+ ```
20+
21+ #### EXAMPLE 2
22+ ``` PowerShell
23+ {
24+ get https://api.github.com/repos/StartAutomating/PipeScript
25+ } | .>PipeScript
26+ ```
27+
28+ #### EXAMPLE 3
29+ ``` PowerShell
30+ Invoke-PipeScript {
31+ $GitHubApi = 'api.github.com'
32+ $UserName = 'StartAutomating'
33+ https://$GitHubApi/users/$UserName
34+ }
35+ ```
36+
37+ #### EXAMPLE 4
38+ ``` PowerShell
39+ -ScriptBlock {
40+ https://$GitHubApi/users/$UserName -GitHubApi api.github.com -UserName StartAutomating
41+ }
42+ ```
43+
44+ #### EXAMPLE 5
45+ ``` PowerShell
46+ -ScriptBlock {
47+ https://$GitHubApi/users/$UserName -GitHubApi api.github.com -UserName StartAutomating
48+ }
49+ ```
50+
51+ #### EXAMPLE 6
52+ ``` PowerShell
53+ -ScriptBlock {
54+ @(foreach ($repo in https://api.github.com/users/StartAutomating/repos?per_page=100) {
55+ $repo | .Name .Stars { $_.stargazers_count }
56+ }) | Sort-Object Stars -Descending
57+ }
58+ ```
59+
60+ #### EXAMPLE 7
61+ ``` PowerShell
62+ {
63+ http://text-processing.com/api/sentiment/ -Method POST -ContentType 'application/x-www-form-urlencoded' -Body "text=amazing!" |
64+ Select-Object -ExpandProperty Probability -Property Label
65+ }
66+ ```
67+
68+ ---
69+ ### Parameters
70+ #### ** CommandUri**
71+
72+ The URI.
73+
74+
75+
76+ | Type | Requried| Postion| PipelineInput |
77+ | -----------| --------| -------| --------------|
78+ | ``` [Uri] ``` | true | 1 | true (ByValue)|
79+ ---
80+ #### ** CommandAst**
81+
82+ The Command's Abstract Syntax Tree
83+
84+
85+
86+ | Type | Requried| Postion| PipelineInput|
87+ | ------------------| --------| -------| -------------|
88+ | ``` [CommandAst] ``` | true | 2 | false |
89+ ---
90+ #### ** Method**
91+
92+ | Type | Requried| Postion| PipelineInput|
93+ | --------------| --------| -------| -------------|
94+ | ``` [String] ``` | false | 3 | false |
95+ ---
96+ ### Syntax
97+ ``` PowerShell
98+ Http.Protocol [-CommandUri] <Uri> [-CommandAst] <CommandAst> [[-Method] <String>] [<CommonParameters>]
99+ ```
100+ ---
101+
102+
You can’t perform that action at this time.
0 commit comments