To change the way AutoRest generates, you can configure:
Sometimes names from cmdlets or parameters contain redundant information. For example:
- A parameter called
VirtualMachineName
from the cmdletGet-VirtualMachine
is somewhat redundant. A better name for such parameter could be justName
. - A cmdlet that has a verb
Get
, prefixContainerService
and subjectContainerService
. The resulting cmdlet will then beGet-ContainerServiceContainerService
. A better name for such cmdlet could just beGet-ContainerService
.
For these cases you can provide the option sanitize-names: true
in the configuration file or --sanitize-names
from the command line. You can disable name sanitization with sanitize-names: false
.
By default, AutoRest's PowerShell Generator will place all the files under this directory layout. The configuration for the default directories can be found in the defaults.md for the PowerShell extension. However, if you want to customize the directory layout, you may specify those nodes at the top-level of your configuration. Here are descriptions for some of the folders/files:
Contains all the code generated. By default, AutoRest will create a folder called 'generated' inside the current working directory. If you want to change the location use:
output-folder: <path>
Contains the low-level C# files and script cmdlets. By default, AutoRest will create a folder called 'generated' inside the output folder. If you want to change the location use:
module-folder: <path>
Contains the low-level C# cmdlet files. By default, AutoRest will create a folder called 'cmdlets' inside the module folder. If you want to change the location use:
cmdlet-folder: <path>
Contains any cmdlet customized by you. Initially it will be empty. By default, AutoRest will create a folder called 'custom' at the top level of the output-folder. If you want to change the location use:
custom-cmdlet-folder: <path>
Contains Pester tests. By default, AutoRest will create a folder called 'test' at the top level of the output-folder. If you want to change the location use:
test-folder: <path>
Contain low level c# files. If you want to change their location, you can use respectively:
runtime-folder: <path>
api-folder: <path>
In addition, if you desire to rename the module name or specific file names, you may use:
module-name: <name>
csproj: <name> # C# project file
psd1: <name> # module manifest file
psm1: <name> # script module file
Note: By default these files will be named after the module-name. For example, the manifest file will be <module-name>.psd1. You can see the full list of file names in the defaults.md for the PowerShell extension.