Use of the beta version of autorest.powershell
requires the following:
- NodeJS LTS (14.x LTS preferred. Will not function with Node < 10.x. )
if you want an easy way to install and update Node, I recommend NVS - Node Version Switcher or NVM - Node Version Manager
- AutoRest v3
npm install -g autorest
- PowerShell 6.0 - If you dont have it installed, you can use the cross-platform npm package
npm install -g pwsh
- Dotnet SDK 2 or greater - If you dont have it installed, you can use the cross-platform npm package
npm install -g dotnet-sdk-2.1
- PowerShell specific options -- see PowerShell Options
- PowerShell specific samples -- see Samples
- Compiling and using the generator yourself - see PowerShell Generator Development
- AutoRest PowerShell Source Code -- the source code to the generator. (Work-in-progress)
To use the PowerShell generator, you have to first install the AutoRest v3:
# Installing AutoRest (beta)
> npm install -g "autorest"
# if you have a previous version installed (or want it to pull the latest version), reset the autorest plugins
> autorest --reset
If you run into a problem, and need to return to the release version of the generator
# Installing AutoRest (release)
> npm install -g autorest
# remove all the installed plugins
> autorest --reset
At a bare minimum, you can generate a powershell module using a swagger or openapi file and using --powershell
.
The output will be in the ./generated
folder by default
# AutoRest command line
> autorest --powershell --input-file:<path-to-swagger-file> [...options]
--powershell
- required to use the powershell generator--input-file:<OpenAPI2 or OpenAPI3 file>
- the OpenAPI2/OpenAPI3/Swagger (.json or .yaml) file to generate the module from--output-folder:<folder>
- you can specify where the output is to be generated--verbose
- get verbose information from autorest as to what is going on--debug
- get debug information from autorest as to what is going on--clear-output-folder
- to clear out previous generated files in the output folder (except files in the custom folder)
- Samples demonstrate some example usage for generating cmdlets.
- Options details about some of the configuration options for manipulating the cmdlet generation process.
- Release Notes information about the current build.
- Filing Bugs make sure that you tag it with the 'powershell' label.
- Command-line-interface - about the autorest command line
- Configuration Files
- Coming Soon: Debugging modules with VSCode made easy.
- Coming Soon: Testing modules with Pester
- Coming Soon: Packaging modules