Skip to content
Branch: master
Find file History
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
samples
debugging-modules.md
default-directory-layout.md
development.md
options.md
packaging-the-module.md
readme.md
release-notes.md
testing-with-pester.md

readme.md

AutoRest PowerShell Generator

Requirements

Use of the beta version of autorest.powershell requires the following:

  • NodeJS LTS (10.15.x LTS preferred. Will not function with Node < 10.x Be Wary of 11.x builds as they may introduce instability or breaking changes. )

if you want an easy way to install and update Node, I recommend NVS - Node Version Switcher or NVM - Node Version Manager

  • AutoRest v3 beta
    npm install -g autorest@beta
     
  • 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
     

Users Quick Links

Developers Quick Links

Installing AutoRest Beta and the PowerShell generator

To use the PowerShell generator, you have to first install the AutoRest v3 beta:

# Installing AutoRest (beta)
> npm install -g autorest@beta

# if you have a previous version installed (or want it to pull the latest version), reset the autorest plugins
> autorest --reset

Returning to the release version of the generator

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

Using AutoRest Powershell

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]

Common AutoRest parameters:

  • --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)

More Information

You can’t perform that action at this time.