Closed peombwa closed 1 year ago
In AutoREST.PowerShell v2.x, cmdlets with Workflows in their operationId were all singularized as follows:
Workflows
operationId
In AutoREST.PowerShell v3.x, the same operations id will now produce a cmdlet with the following name:
Using the sample at https://gist.github.com/peombwa/c4f1a68442dfe5d636d424225b5e5e88, generate PowerShell modules using:
autorest --powershell --use:@autorest/powershell@2.1.401 --input-file:"https://gist.githubusercontent.com/peombwa/c4f1a68442dfe5d636d424225b5e5e88/raw/a4074bec0a4a36972f46be35f9a9c70b8642a4bc/lifecycleWorkflows.yml" --output-folder:V2
autorest --powershell --input-file:"https://gist.githubusercontent.com/peombwa/c4f1a68442dfe5d636d424225b5e5e88/raw/a4074bec0a4a36972f46be35f9a9c70b8642a4bc/lifecycleWorkflows.yml" --output-folder:V3
Inspect the command names at .\V2\generated\cmdlets\ and .\V3\generated\cmdlets\, generated using AutoREST.PowerShell v2.x and v3.x respectively.
.\V2\generated\cmdlets\
.\V3\generated\cmdlets\
As a workaround, we able to use the following rename directive to manually singularize and deduplicate Workflows:
- where: subject: (.*)(LifecycleWorkflow)sWorkflow(.*) set: subject: $1$2$3
Fixed in autorest.powershell v4.
In AutoREST.PowerShell v2.x, cmdlets with
Workflows
in theiroperationId
were all singularized as follows:In AutoREST.PowerShell v3.x, the same operations id will now produce a cmdlet with the following name:
Repro Steps
Using the sample at https://gist.github.com/peombwa/c4f1a68442dfe5d636d424225b5e5e88, generate PowerShell modules using:
AutoREST.PowerShell v2.x
AutoREST.PowerShell v3.x
Inspect the command names at
.\V2\generated\cmdlets\
and.\V3\generated\cmdlets\
, generated using AutoREST.PowerShell v2.x and v3.x respectively.Workaround
As a workaround, we able to use the following rename directive to manually singularize and deduplicate
Workflows
: