Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Commands in WindowsUpdates module. #683

Merged
merged 1 commit into from
Jun 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/ModulesMapping.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
"Users": "^users.user$|^users.directoryObject$|^users.licenseDetails$|^users.notification$|^users.outlookUser$|^users.profilePhoto$|^users.userSettings$|^users.extension$|^users.oAuth2PermissionGrant$|^users.todo$",
"Users.Actions": "^users.Actions$",
"Users.Functions": "^users.Functions$",
// "WindowsUpdates": "^admin.windows$|^admin.Actions$|^admin.Functions$",
"WindowsUpdates": "^admin.windows$|^admin.Actions$|^admin.Functions$",
// "WorkBooks": "^workbooks\\.",// Max limit.
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Microsoft Corporation
#
# Generated on: 5/11/2021
# Generated on: 6/3/2021
#

@{
Expand All @@ -12,13 +12,13 @@
RootModule = './Microsoft.Graph.WindowsUpdates.psm1'

# Version number of this module.
ModuleVersion = '1.5.1'
ModuleVersion = '1.6.0'

# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'

# ID used to uniquely identify this module
GUID = '63972427-8001-4871-948c-cad3ec54dbc4'
GUID = 'c7c46995-0a76-42ce-b3d7-46a59e4f84c6'

# Author of this module
Author = 'Microsoft Corporation'
Expand Down Expand Up @@ -69,28 +69,29 @@ FormatsToProcess = './Microsoft.Graph.WindowsUpdates.format.ps1xml'
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = 'Add-MgWindowsUpdateDeploymentAudienceMember',
'Add-MgWindowsUpdateDeploymentAudienceMemberById',
'Add-MgWindowsUpdateUpdatableAssetMember',
'Add-MgWindowsUpdateUpdatableAssetMemberById',
'Get-MgWindowsUpdateCatalogEntry', 'Get-MgWindowsUpdateDeployment',
'Get-MgWindowsUpdateDeploymentAudienceExclusion',
'Get-MgWindowsUpdateDeploymentAudienceMember',
'Get-MgWindowsUpdateUpdatableAsset',
'Invoke-MgEnrollWindowsUpdateUpdatableAsset',
'Invoke-MgEnrollWindowsUpdateUpdatableAssetById',
'Invoke-MgUnenrollWindowsUpdateUpdatableAsset',
'Invoke-MgUnenrollWindowsUpdateUpdatableAssetById',
'New-MgWindowsUpdateDeployment',
'New-MgWindowsUpdateUpdatableAsset',
'Remove-MgWindowsUpdateDeployment',
'Remove-MgWindowsUpdateUpdatableAsset',
'Remove-MgWindowsUpdateUpdatableAssetMember',
'Remove-MgWindowsUpdateUpdatableAssetMemberById',
'Update-MgWindowsUpdateDeployment',
'Update-MgWindowsUpdateDeploymentAudience',
'Update-MgWindowsUpdateDeploymentAudienceById',
'Update-MgWindowsUpdateUpdatableAsset'
FunctionsToExport = 'Add-MgWindowsUpdatesDeploymentAudienceMember',
'Add-MgWindowsUpdatesDeploymentAudienceMemberById',
'Add-MgWindowsUpdatesUpdatableAssetMember',
'Add-MgWindowsUpdatesUpdatableAssetMemberById',
'Get-MgWindowsUpdatesCatalogEntry',
'Get-MgWindowsUpdatesDeployment',
'Get-MgWindowsUpdatesDeploymentAudienceExclusion',
'Get-MgWindowsUpdatesDeploymentAudienceMember',
'Get-MgWindowsUpdatesUpdatableAsset',
'Invoke-MgEnrollWindowsUpdatesUpdatableAsset',
'Invoke-MgEnrollWindowsUpdatesUpdatableAssetById',
'Invoke-MgUnenrollWindowsUpdatesUpdatableAsset',
'Invoke-MgUnenrollWindowsUpdatesUpdatableAssetById',
'New-MgWindowsUpdatesDeployment',
'New-MgWindowsUpdatesUpdatableAsset',
'Remove-MgWindowsUpdatesDeployment',
'Remove-MgWindowsUpdatesUpdatableAsset',
'Remove-MgWindowsUpdatesUpdatableAssetMember',
'Remove-MgWindowsUpdatesUpdatableAssetMemberById',
'Update-MgWindowsUpdatesDeployment',
'Update-MgWindowsUpdatesDeploymentAudience',
'Update-MgWindowsUpdatesDeploymentAudienceById',
'Update-MgWindowsUpdatesUpdatableAsset'

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()
Expand Down
24 changes: 12 additions & 12 deletions src/WindowsUpdates/WindowsUpdates/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,66 +44,66 @@ directive:
- where:
subject: (.*)AdminWindowUpdate(.*)
set:
subject: $1WindowsUpdate$2
subject: $1WindowsUpdates$2
# Remove cmdlets.
- where:
subject: ^WindowsUpdateCatalog$
subject: ^WindowsUpdatesCatalog$
remove: true
- where:
verb: New|Remove|Update
subject: ^WindowsUpdate(CatalogEntry|DeploymentAudienceMember|DeploymentAudienceExclusion)$
subject: ^WindowsUpdates(CatalogEntry|DeploymentAudienceMember|DeploymentAudienceExclusion)$
remove: true
- where:
verb: Add|Remove
subject: ^WindowsUpdateDeploymentAudience(ExclusionMember|ExclusionMemberById)$
subject: ^WindowsUpdatesDeploymentAudience(ExclusionMember|ExclusionMemberById)$
remove: true
- where:
verb: Invoke
subject: ^(Enroll|UnEnroll)WindowsUpdateDeploymentAudience(ExclusionAsset|ExclusionAssetById|MemberAsset|MemberAssetById)$
subject: ^(Enroll|UnEnroll)WindowsUpdatesDeploymentAudience(ExclusionAsset|ExclusionAssetById|MemberAsset|MemberAssetById)$
remove: true
# Rename cmdlets.
- where:
verb: Add
subject: ^(WindowsUpdate)(DeploymentAudienceExclusion|DeploymentAudience|UpdatableAsset)(Member)$
subject: ^(WindowsUpdates)(DeploymentAudienceExclusion|DeploymentAudience|UpdatableAsset)(Member)$
variant: ^Add1$|^AddExpanded1$|^AddViaIdentity1$|^AddViaIdentityExpanded1$
set:
subject: $1$2$3ById
- where:
verb: Remove
subject: ^(WindowsUpdate)(DeploymentAudienceExclusion|DeploymentAudience|UpdatableAsset)(Member)$
subject: ^(WindowsUpdates)(DeploymentAudienceExclusion|DeploymentAudience|UpdatableAsset)(Member)$
variant: ^Remove1$|^RemoveExpanded1$|^RemoveViaIdentity1$|^RemoveViaIdentityExpanded1$
set:
subject: $1$2$3ById
- where:
verb: Invoke
subject: ^(EnrollWindowsUpdate)(DeploymentAudienceExclusion|DeploymentAudienceMember|Updatable)(Asset)$
subject: ^(EnrollWindowsUpdates)(DeploymentAudienceExclusion|DeploymentAudienceMember|Updatable)(Asset)$
variant: ^Enroll1$|^EnrollExpanded1$|^EnrollViaIdentity1$|^EnrollViaIdentityExpanded1$
set:
subject: $1$2$3ById
- where:
verb: Invoke
subject: ^(UnenrollWindowsUpdate)(DeploymentAudienceExclusion|DeploymentAudienceMember|Updatable)(Asset)$
subject: ^(UnenrollWindowsUpdates)(DeploymentAudienceExclusion|DeploymentAudienceMember|Updatable)(Asset)$
variant: ^Unenroll1$|^UnenrollExpanded1$|^UnenrollViaIdentity1$|^UnenrollViaIdentityExpanded1$
set:
subject: $1$2$3ById
- where:
verb: Update
subject: ^(WindowsUpdateDeploymentAudience)$
subject: ^(WindowsUpdatesDeploymentAudience)$
variant: ^Update1$|^UpdateExpanded1$|^UpdateViaIdentity1$|^UpdateViaIdentityExpanded1$
set:
subject: $1ById
# Alias cmdlets.
# NB: We have to rename the command to the desired alias name, alias based on the rename, then undo the rename due to:
# - https://github.com/Azure/autorest.powershell/issues/769
- where:
subject: (.*)(WindowsUpdate)(.*)
subject: (.*)(WindowsUpdates)(.*)
set:
subject: $1Wu$3
alias: ${verb}-Mg${subject}
- where:
subject: (.*)(Wu)(.*)
set:
subject: $1WindowsUpdate$3
subject: $1WindowsUpdates$3
```
### Versioning

Expand Down