@@ -405,11 +405,7 @@ directive:
405405 variant : ^(Check|Verify)(.*)
406406 set :
407407 verb : Confirm
408- # Rename all /$ref cmdlets to *ByRef e.g. New-MgGroupOwnerByRef
409- - from : ' openapi-document'
410- where : $.paths..operationId
411- transform : |
412- return ($.endsWith("ByRef")) ? $.replace("_", "GraphRef_") : $
408+ # Add ByRef suffix to /$ref cmdlets
413409 - where :
414410 subject : ^(\w*[a-z])GraphRef([A-Z]\w*)$
415411 set :
@@ -423,19 +419,19 @@ directive:
423419 - where :
424420 verb : Get|New
425421 subject : ^GroupMemberByRef$
426- variant : ^List $|^Create $|^CreateExpanded $|^CreateViaIdentity $|^CreateViaIdentityExpanded $|^List3 $|^Create3 $|^CreateExpanded3 $|^CreateViaIdentity3 $|^CreateViaIdentityExpanded3 $
422+ variant : ^List2 $|^Create2 $|^CreateExpanded2 $|^CreateViaIdentity2 $|^CreateViaIdentityExpanded2 $|^List5 $|^Create5 $|^CreateExpanded5 $|^CreateViaIdentity5 $|^CreateViaIdentityExpanded5 $
427423 set :
428424 subject : GroupMemberOfByRef
429425 - where :
430426 verb : Get|New
431427 subject : ^GroupMemberByRef$
432- variant : ^List2 $|^Create2 $|^CreateExpanded2 $|^CreateViaIdentity2 $|^CreateViaIdentityExpanded2 $|^List5 $|^Create5 $|^CreateExpanded5 $|^CreateViaIdentity5 $|^CreateViaIdentityExpanded5 $
428+ variant : ^List1 $|^Create1 $|^CreateExpanded1 $|^CreateViaIdentity1 $|^CreateViaIdentityExpanded1 $|^List4 $|^Create4 $|^CreateExpanded4 $|^CreateViaIdentity4 $|^CreateViaIdentityExpanded4 $
433429 set :
434430 subject : GroupMemberWithLicenseErrorByRef
435431 - where :
436- verb : Get
432+ verb : Get|New
437433 subject : ^GroupTransitiveMemberByRef$
438- variant : ^List$|^List2$
434+ variant : ^List$|^List2$|^Create$|^Create2$|^CreateExpanded$|^CreateExpanded2$|^CreateViaIdentity$|^CreateViaIdentity2$|^CreateViaIdentityExpanded$|^CreateViaIdentityExpanded2$
439435 set :
440436 subject : GroupTransitiveMemberOfByRef
441437# Alias then rename cmdlets to avoid breaking change.
@@ -558,7 +554,9 @@ directive:
558554 $ = $.replace(psBaseClassImplementationRegex, '$1Microsoft.Graph.PowerShell.Cmdlets.Custom.ListCmdlet');
559555
560556 let beginProcessingRegex = /(^\s*)(protected\s*override\s*void\s*BeginProcessing\(\)\s*{)/gmi
561- $ = $.replace(beginProcessingRegex, '$1$2\n$1 if (this.InvocationInformation?.BoundParameters != null){ InitializeCmdlet(ref this.__invocationInfo, ref this._top, ref this._count); }\n$1');
557+ let topPlaceholder = (!$.includes("private int _top;")) ? 'int _top = default;': ''
558+ let countPlaceholder = (!$.includes("SwitchParameter _count;")) ? 'global::System.Management.Automation.SwitchParameter _count;': ''
559+ $ = $.replace(beginProcessingRegex, `$1$2\n$1 ${countPlaceholder} ${topPlaceholder} if (this.InvocationInformation?.BoundParameters != null){ InitializeCmdlet(ref this.__invocationInfo, ref _top, ref _count); }\n$1`);
562560
563561 let odataNextLinkCallRegex = /(^\s*)(await\s*this\.Client\.UsersUserListUser_Call\(requestMessage\,\s*onOk\,\s*onDefault\,\s*this\,\s*Pipeline\)\;)/gmi
564562 $ = $.replace(odataNextLinkCallRegex, '$1requestMessage.RequestUri = GetOverflowItemsNextLinkUri(requestMessage.RequestUri);\n$1$2');
0 commit comments