Skip to content

Commit 27ecb4a

Browse files
authored
Add CrescendoBuilt to docs (#93)
1 parent e74c14a commit 27ecb4a

File tree

2 files changed

+51
-41
lines changed

2 files changed

+51
-41
lines changed

reference/ps-modules/Microsoft.PowerShell.Crescendo/About/about_Crescendo.md

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Describes the purpose of the Crescendo module.
33
Locale: en-US
4-
ms.date: 01/21/2022
4+
ms.date: 08/18/2022
55
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.crescendo/about/about_Microsoft.PowerShell.Crescendo?view=ps-modules.1&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Microsoft.PowerShell.Crescendo
@@ -10,26 +10,26 @@ title: about_Microsoft.PowerShell.Crescendo
1010

1111
## about_Microsoft.PowerShell.Crescendo
1212

13-
## SHORT DESCRIPTION
13+
## Short description
1414

1515
The PowerShell Crescendo module provides a novel way to create proxy functions
1616
for native commands via `JSON` configuration files.
1717

18-
## LONG DESCRIPTION
18+
## Long description
1919

2020
PowerShell is capable of invoking native applications like any shell. However,
2121
it would improve the experience if the native command could participate in the
2222
PowerShell pipeline and take advantage of the parameter behaviors that are part
2323
of PowerShell.
2424

25-
The PowerShell Crescendo module provides a way to more easily take advantage of
26-
the PowerShell pipeline by invoking the native executable, facilitating
27-
parameter handling, and converting text output into objects.
25+
The PowerShell Crescendo module provides a way to take advantage of the
26+
PowerShell pipeline by invoking the native executable, facilitating parameter
27+
handling, and converting text output into objects.
2828

2929
## JSON Configuration
3030

3131
The PowerShell Crescendo module provides a way to create a small bit of JSON
32-
that is used to create a function that calls the native command.
32+
that's used to create a function that calls the native command.
3333

3434
An annotated schema is provided as part of the module that can improve the
3535
authoring process.
@@ -41,9 +41,9 @@ commands in the same way you do with cmdlets.
4141

4242
## Output Handling
4343

44-
It is also possible to provide a script block that can be used to convert the
45-
output from the native command into objects. If the native command emits `json`
46-
or `xml` it is as simple as:
44+
It's also possible to create a script block that can be used to convert the
45+
output from the native command into objects. If the native command emits JSON
46+
or XML it can be as simple as:
4747

4848
```json
4949
"OutputHandler": [
@@ -54,12 +54,12 @@ or `xml` it is as simple as:
5454

5555
However, script blocks of arbitrary complexity may also be used.
5656

57-
## EXAMPLES
57+
## Examples
5858

59-
A number of samples are provided as part of the module, you can see these in
60-
the Samples directory in the module base directory.
59+
Several samples are provided as part of the module. You can find these in the
60+
`Samples` directory of the module base directory.
6161

62-
A very simple example is as follows to wrap the unix `/bin/ls` command:
62+
The following JSON is a minimal example that wraps the unix `/bin/ls` command:
6363

6464
```json
6565
{
@@ -68,32 +68,42 @@ A very simple example is as follows to wrap the unix `/bin/ls` command:
6868
"Noun":"FileList",
6969
"OriginalName": "/bin/ls",
7070
"Parameters": [
71-
{"Name": "Path","OriginalName": "", "OriginalPosition": 1, "Position": 0, "DefaultValue": "." },
72-
{"Name": "Detail","OriginalName": "-l","ParameterType": "switch"}
71+
{
72+
"Name": "Path",
73+
"OriginalName": "",
74+
"OriginalPosition": 1,
75+
"Position": 0,
76+
"DefaultValue": "."
77+
},
78+
{
79+
"Name": "Detail",
80+
"OriginalName": "-l",
81+
"ParameterType": "switch"
82+
}
7383
]
7484
}
7585
```
7686

7787
The name of the proxy function is `Get-FileList` and has two parameters:
7888

79-
- Path
89+
- **Path**
8090
- Which is Position 0, and has a default value of "."
81-
- Detail
91+
- **Detail**
8292
- Which is a switch parameter and adds `-l` to the native command parameters
8393

8494
A couple of things to note about the Path parameter
8595

8696
- The `OriginalPosition` is set to 1 and the `OriginalName` is set to an empty
87-
string. This is because some native commands have a parameter which is _not_
88-
named and must be the last parameter when executed. All parameters will be
89-
ordered by the value of `OriginalPosition` (the default is 0) and when the
90-
native command is called, those parameters (and their values) will be put in
91-
that order.
97+
string. This is because some native commands have a parameter that is _not_
98+
named and must be the last parameter when executed. All parameters get
99+
ordered by the value of `OriginalPosition` (the default is 0). When the
100+
native command is called, those parameters (and their values) are put in that
101+
order.
92102

93103
In this example, there is no output handler defined, so the text output of the
94-
command will be returned to the pipeline.
104+
command is returned to the pipeline.
95105

96-
A more complicated example which wraps the linux `apt` command follows:
106+
The following is a more complicated example that wraps the linux `apt` command:
97107

98108
```json
99109
{
@@ -117,7 +127,7 @@ A more complicated example which wraps the linux `apt` command follows:
117127

118128
In this case, the output handler converts the text output to a `pscustomobject`
119129
to enable using other PowerShell cmdlets. When run, this provides an object
120-
which encapsulates the `apt` output
130+
that encapsulates the `apt` output
121131

122132
```powershell
123133
PS> get-installedpackage | ?{ $_.name -match "libc"}
@@ -138,16 +148,10 @@ Count Name Group
138148
82 amd64 {@{Name=apt; Version=2.0.2ubuntu0.1; Architecture=amd64; State=System.String[]}, @{Name=base-files…
139149
```
140150

141-
## TROUBLESHOOTING NOTE
142-
143-
The PowerShell Crescendo module is still very early in the development process,
144-
so we expect changes to be made.
145-
146-
One issue is that the output handler is currently a string, so constructing the
147-
script block may be complex; semi-colons will be required to separate
148-
statements. This may be addressed in a later version.
151+
## See also
149152

150-
## SEE ALSO
153+
The PowerShell Crescendo module is still in the development process, so we
154+
expect changes to be made.
151155

152156
The GitHub repository may be found at:
153157
[https://github.com/PowerShell/Crescendo](https://github.com/PowerShell/Crescendo).
@@ -158,6 +162,6 @@ command wrapping can be found here:
158162
- [Part 1](https://devblogs.microsoft.com/powershell/native-commands-in-powershell-a-new-approach/)
159163
- [Part 2](https://devblogs.microsoft.com/powershell/native-commands-in-powershell-a-new-approach-part-2))
160164

161-
## KEYWORDS
165+
## Keywords
162166

163167
Native Command

reference/ps-modules/Microsoft.PowerShell.Crescendo/Export-CrescendoModule.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Export-CrescendoModule netsh netsh*.json -force
4343

4444
### -ConfigurationFile
4545

46-
This is a list of JSON files which represent the proxies for the module
46+
This is a list of JSON files that represent the proxies for the module.
4747

4848
```yaml
4949
Type: System.String[]
@@ -59,9 +59,8 @@ Accept wildcard characters: True
5959
6060
### -Force
6161
62-
By default, if `Export-CrescendoModule` finds an already created module, it will not overwrite the
63-
existing file. Use the **Force** parameter to overwrite the existing file, or remove it prior to
64-
running `Export-CrescendoModule`.
62+
By default, if `Export-CrescendoModule` does not overwrite an existing module. Use the **Force**
63+
parameter to overwrite the existing file, or remove it before running `Export-CrescendoModule`.
6564

6665
```yaml
6766
Type: System.Management.Automation.SwitchParameter
@@ -109,7 +108,7 @@ Accept wildcard characters: False
109108

110109
### -WhatIf
111110

112-
Shows what would happen if the cmdlet runs. The cmdlet is not run.
111+
Shows what would happen if the cmdlet runs. The cmdlet isn't run.
113112

114113
```yaml
115114
Type: System.Management.Automation.SwitchParameter
@@ -144,6 +143,13 @@ individual function. Finally, all proxies are used to create an `Export-ModuleMe
144143
invocation, so when the resultant module is imported, the module has all the command proxies
145144
available.
146145

146+
`Export-CrescendoModule` adds the **CrescendoBuilt** tag to the module manifest. You can use this
147+
tag to find modules in the PowerShell Gallery that were created using Crescendo. For more
148+
information, see:
149+
150+
- [Gallery Search Syntax](/powershell/scripting/gallery/how-to/finding-packages/search-syntax)
151+
- [Find-Module](/powershell/module/powershellget/find-module)
152+
147153
## RELATED LINKS
148154

149155
[Import-CommandConfiguration](Import-CommandConfiguration.md)

0 commit comments

Comments
 (0)