You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: clu-getstart.md
+20-9Lines changed: 20 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -25,27 +25,25 @@ CLUPackages require some additional files to direct generation of indexing, and
25
25
| NounPrefix | ‘AzureRm’ The part of the cmdlet noun to remove in clu commands|
26
26
| NounFirst | if true, the verb comes at the end of the command (e.g. azure resource get)|
27
27
28
-
* Tools\Azure.Bat: contains the batch file command for running cmdlets in the clu. Do not change
29
-
*\<modulename\>.nuspec.template, which contains nuspec format metadata about the package – the base temaplate is in tools\clu\Microsoft.Azure.Commands.nuspec.template.
28
+
*\<modulename\>.nuspec.template, which contains nuspec format metadata about the package – the base temaplate is in tools\clu\Microsoft.Azure.Commands.nuspec.template. Here are the special fields defined in this template:
30
29
* %PackageId% - replace with the module name (Microsoft.Azure.Commands.\<rp-name\>)
31
-
* %PackageTitle% Title of the cmdlet package in nuget
30
+
* %PackageTitle% Title of the cmdlet package in nuget, replace with the title that should show up in nuget ui
32
31
* %PackageVersion%, %ReferenceFiles%,%SourceFiles%,%ContentFiles% - Filled in by build tool
33
-
* %PackageSummary% - Summary field in nuget ui
34
-
* %PackageDescription% - Log description in package ui
32
+
* %PackageSummary% - Summary field in nuget ui, replace with the summary data for your package
33
+
* %PackageDescription% - Long description in package ui, replace with the long description for your package.
35
34
* Almost all cmdlets packages should add a dependency to Microsoft.Azure.Commands.Profile package
36
35
37
36
* Ensure that project.json is set to expose a command entrypoint: `"compilationOptions": {"emitEntryPoint": true}`
38
37
* Ensure that the project implements at least one console entry point
39
-
```c#
38
+
```c#
40
39
publicclassEntryStub
41
40
{
42
41
publicstaticvoidMain(string[] args)
43
42
{
44
43
// empty entry point
45
44
}
46
45
}
47
-
48
-
```
46
+
```
49
47
50
48
### Package Creation and Testing
51
49
2 options
@@ -62,8 +60,21 @@ To test on osx/linux boxes, do #1, open `<repo-root>\drop\clurun`, you should se
62
60
63
61
### Quick introductions on cmdlets
64
62
* Run commands using the ‘azure’ prefix, cmdlet nouns, and cmdlet verbs, for example, `azure environment get` maps to the cmdlet `Get-AzureRmEnvironment`
65
-
* Cmdlet parameters use the double dash (--) so for example, getting a subscription with a particular name would be: `azure subscription get –SubscriptionName “name of subscription"`
63
+
* Cmdlet parameters use the double dash (--) so for example, getting a subscription with a particular name would be: `azure subscription get –-SubscriptionName “name of subscription"`
66
64
* To log in, 3 options
67
65
* login interactively using device flow, this is the only option for msa account or any org-id with 2fa enforced, example: `azure account add`
68
66
* login with user and password, this works on org-id w/o 2fa enforced, example: `azure account add --Username [email protected] --Password password1`
69
67
* login as service principal. Example: `azure account add --ServicePrincipal --TenantId <tenant> --ApplicationId <id> --Secret <secret>`
68
+
* Piping between cmdlets should work the same way that Powerhell piping works
69
+
```azure subscription get --SubscriptionName | azure context set```
70
+
* You can capture piped output using redirection to a file - the result will be the json serialization of the output object.
71
+
```azure subscription get > subscriptions.json```
72
+
* You can use file input tu aparameter using '@' notation:
73
+
```azure command --param1 @file1.json```
74
+
Reads input from file1.json and attempts to deserialize the .net object that is the Parameter type for ```param1```
75
+
```azure command --param1 @@file1.json```
76
+
Does the same thing, but treats the input from ```file1.json``` as if it come from the pipeline, so that multiple objects will result in multiple invocations of ```ProcessRecord()``` for the target cmdlet.
77
+
* There are some known issues with the current approach to sessions, which can cause session variables to not be propagated when running cmdlets in a pipeline, to work around this, set the 'CmdletSessionId' environment variable to a numeric value - all cmdlets running from the shell will use that session id, and sessions will work with pipelining
0 commit comments