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
{{ message }}
This repository was archived by the owner on Sep 27, 2019. It is now read-only.
| Developer | Windows, Any full PowerShell version, PowerShell Core (NOTE: AzureRM.Profile is currently broken on beta.1, but a new module should be released soon)|
27
-
| Module Publisher|Any full PowerShell version|
28
-
| Module Consumer |Any full PowerShell version, PowerShell Core Alpha11 or older|
**Future note**: We plan on supporting PowerShell 4+ for module consumers in the future; that scenario is untested currently.
30
31
**Testing note**: While any full PowerShell version is fine for development, we recommend using PowerShell 5.1+ to enable testing our implementation of Get-FileHash.
31
32
32
33
## Dependencies
@@ -40,11 +41,16 @@ A PowerShell module with commands to generate the PowerShell commands for a give
40
41
| AzureRM.Profile.NetCore.Preview | * | Module containing authentication helpers, required for Microsoft Azure modules on PowerShell Core |
NOTE: In the short term, for best performance, the operation IDs in your Open API specifications should be of the form "<Noun>_<Verb><Suffix>". For example, the operation ID "Resource_GetByName" gets a resource named Resource by name.
4. If you plan on precompiling the generated assembly, ensure you have the module AzureRM.Profile or AzureRM.NetCore.Preview available to PackageManagement if you are on PowerShell or PowerShell Core, respectively.
60
67
61
68
5. Run the following in a PowerShell console from the directory where you cloned PSSwagger in
# This specification is for a Microsoft Azure service, so use Azure-specific functionality
80
+
UseAzureCsharpGenerator = $true
81
+
}
82
+
# You may be prompted to download missing dependencies
83
+
New-PSSwaggerModule @param
84
+
```
85
+
The generated module will be in the `C:\Temp\GeneratedModule\Generated.AzureRM.BatchManagement` folder.
86
+
For more New-PSSwaggerModule options, check out the [documentation](/docs/commands/New-PSSwaggerModule.md).
87
+
6. Your generated module is now ready! For production modules (i.e. modules you will publish to PowerShellGallery.com), we recommend using the -IncludeCoreFxAssembly option to generate the Core CLR assembly, strong name signing assemblies in the generated module, and authenticode signing the module. Optionally, you can remove the generated C# code (under the Generated.CSharp folder) for even more security.
88
+
89
+
## Metadata Generation
90
+
There are many cases where module generation doesn't result in the most optimal names for things like parameters or commands. To enable this and many other customization options, we've introduced additional PowerShell-specific Open API extensions that can be specified separately from your main specification. For more information, check out [PowerShell Extensions](/docs/extensions/readme.md) and [New-PSSwaggerMetadataFile](/docs/commands/New-PSSwaggerMetadataFile.md).
82
91
83
92
## Dynamic generation of C# assembly
84
-
When importing the module for the first time, the packaged C# files will be automatically compiled if the expected assembly doesn't exist.
85
-
If the module's script files are signed, regardless of your script execution policy, the catalog file's signing will be checked for validity.
86
-
If the generated module is not signed, the catalog file's signing will not be checked. However, the catalog file's hashed contents will always be checked.
87
-
88
-
## Distribution of module
89
-
Because of the dynamic compilation feature, it is highly recommended that publishers of a generated module Authenticode sign the module and strong name sign both precompiled assemblies (full CLR and core CLR).
93
+
When importing the module for the first time, the packaged C# files will be automatically compiled if the expected assembly doesn't exist.
90
94
91
95
## Microsoft.Rest.ServiceClientTracing support
92
96
To enable Microsoft.Rest.ServiceClientTracing support, pass -Debug into any generated command.
0 commit comments