Skip to content

Commit

Permalink
Move Policy CRUD cmdlets to autorest generation: fixes (#23518) (#24221)
Browse files Browse the repository at this point in the history
* Move Policy CRUD cmdlets to autorest generation: fixes (#23518)

* Set all tests to -LiveOnly
Add back some test infrastructure fixes that were lost
Improve parameter handling for Remove-AzPolicySetDefinition

* Move to supported way of sharing Helpers.psm1 file

* Switch to recommended approach for shared functions

* Update to autorest 4.x (#24319)

Update to Azure Policy 2023-04-01
Move to non-versioned interface types
Complete full test suite for existing cmdlets
Few bug fixes
Add completer for Location parameter
Fix record/playback, remove -LiveOnly tags
Make test names repeatable to work with record/playback
Implement resource group functions that became inaccessible
Fix test failures due to default parameter injection

* Update Policy CRUD cmdlets (#24361)

* Update to autorest 4.x
Update to Azure Policy 2023-04-01
Move to non-versioned interface types
Complete full test suite for existing cmdlets
Few bug fixes
Add completer for Location parameter
Fix record/playback, remove -LiveOnly tags
Make test names repeatable to work with record/playback
Implement resource group functions that became inaccessible
Fix test failures due to default parameter injection

* Clean up some transforms in README
Remove unsupported (for now) parameters
Streamline common test code
Move common test code to utils.ps1
Add serialization of test variables to env.json

* Remove extra parameters from Get-AzPolicyAssignment
Rerecord the tests

* Fix calculation for $testFilesFolder on macOS/linux (#24408)

* Update to autorest 4.x
Update to Azure Policy 2023-04-01
Move to non-versioned interface types
Complete full test suite for existing cmdlets
Few bug fixes
Add completer for Location parameter
Fix record/playback, remove -LiveOnly tags
Make test names repeatable to work with record/playback
Implement resource group functions that became inaccessible
Fix test failures due to default parameter injection

* Clean up some transforms in README
Remove unsupported (for now) parameters
Streamline common test code
Move common test code to utils.ps1
Add serialization of test variables to env.json

* Remove extra parameters from Get-AzPolicyAssignment
Rerecord the tests

* Fix $testFilesFolder calculation to work on macOS/linux.

* Hide generated parameter sets for New-* (#24507)

* Update to autorest 4.x
Update to Azure Policy 2023-04-01
Move to non-versioned interface types
Complete full test suite for existing cmdlets
Few bug fixes
Add completer for Location parameter
Fix record/playback, remove -LiveOnly tags
Make test names repeatable to work with record/playback
Implement resource group functions that became inaccessible
Fix test failures due to default parameter injection

* Clean up some transforms in README
Remove unsupported (for now) parameters
Streamline common test code
Move common test code to utils.ps1
Add serialization of test variables to env.json

* Remove extra parameters from Get-AzPolicyAssignment
Rerecord the tests

* Fix $testFilesFolder calculation to work on macOS/linux.

* Hide generated parameter sets for New-*
Correct definitions, validation, and tests for New-AzPolicyAssignment parameters
Re-record all tests

* Replace Get-AzContext with Utils\Get-SubscriptionIdTestSafe (#24540)

* Update to autorest 4.x
Update to Azure Policy 2023-04-01
Move to non-versioned interface types
Complete full test suite for existing cmdlets
Few bug fixes
Add completer for Location parameter
Fix record/playback, remove -LiveOnly tags
Make test names repeatable to work with record/playback
Implement resource group functions that became inaccessible
Fix test failures due to default parameter injection

* Clean up some transforms in README
Remove unsupported (for now) parameters
Streamline common test code
Move common test code to utils.ps1
Add serialization of test variables to env.json

* Remove extra parameters from Get-AzPolicyAssignment
Rerecord the tests

* Fix $testFilesFolder calculation to work on macOS/linux.

* Hide generated parameter sets for New-*
Correct definitions, validation, and tests for New-AzPolicyAssignment parameters
Re-record all tests

* Replace Get-AzContext with Utils\Get-SubscriptionIdTestSafe
Move to autorest 4.0.690
Update managed identity properties to match generation changes
Remove several parameter transforms no longer needed
Rerecord all tests
91 tests still failing on -Playback with the same signature

* Remove location completer from exports/docs/examples/help

* Improve location completer tests

* Remove transforms for Scope and Id parameters no longer needed
Update cmdlets to use Scope and Id directly
Rerecord all tests
All tests pass in -Record mode
Failures in -Playback mode unchanged

* Apply changes to support -Playback mode (#24555)

* Update to autorest 4.x
Update to Azure Policy 2023-04-01
Move to non-versioned interface types
Complete full test suite for existing cmdlets
Few bug fixes
Add completer for Location parameter
Fix record/playback, remove -LiveOnly tags
Make test names repeatable to work with record/playback
Implement resource group functions that became inaccessible
Fix test failures due to default parameter injection

* Clean up some transforms in README
Remove unsupported (for now) parameters
Streamline common test code
Move common test code to utils.ps1
Add serialization of test variables to env.json

* Remove extra parameters from Get-AzPolicyAssignment
Rerecord the tests

* Fix $testFilesFolder calculation to work on macOS/linux.

* Hide generated parameter sets for New-*
Correct definitions, validation, and tests for New-AzPolicyAssignment parameters
Re-record all tests

* Replace Get-AzContext with Utils\Get-SubscriptionIdTestSafe
Move to autorest 4.0.690
Update managed identity properties to match generation changes
Remove several parameter transforms no longer needed
Rerecord all tests
91 tests still failing on -Playback with the same signature

* Remove location completer from exports/docs/examples/help

* Improve location completer tests

* Remove transforms for Scope and Id parameters no longer needed
Update cmdlets to use Scope and Id directly
Rerecord all tests
All tests pass in -Record mode
Failures in -Playback mode unchanged

* Change location completer to lazy load (vs. module load)
Preserve "extra" input parameters in Update-* calls to Get-* in order to support -Playback test mode
Tag test files that don't support -Playback mode as LiveOnly
Rerecord all recording files

* move creation of resource group to utils.ps1

* Test tweaks (#24566)

* Update to autorest 4.x
Update to Azure Policy 2023-04-01
Move to non-versioned interface types
Complete full test suite for existing cmdlets
Few bug fixes
Add completer for Location parameter
Fix record/playback, remove -LiveOnly tags
Make test names repeatable to work with record/playback
Implement resource group functions that became inaccessible
Fix test failures due to default parameter injection

* Clean up some transforms in README
Remove unsupported (for now) parameters
Streamline common test code
Move common test code to utils.ps1
Add serialization of test variables to env.json

* Remove extra parameters from Get-AzPolicyAssignment
Rerecord the tests

* Fix $testFilesFolder calculation to work on macOS/linux.

* Hide generated parameter sets for New-*
Correct definitions, validation, and tests for New-AzPolicyAssignment parameters
Re-record all tests

* Replace Get-AzContext with Utils\Get-SubscriptionIdTestSafe
Move to autorest 4.0.690
Update managed identity properties to match generation changes
Remove several parameter transforms no longer needed
Rerecord all tests
91 tests still failing on -Playback with the same signature

* Remove location completer from exports/docs/examples/help

* Improve location completer tests

* Remove transforms for Scope and Id parameters no longer needed
Update cmdlets to use Scope and Id directly
Rerecord all tests
All tests pass in -Record mode
Failures in -Playback mode unchanged

* Change location completer to lazy load (vs. module load)
Preserve "extra" input parameters in Update-* calls to Get-* in order to support -Playback test mode
Tag test files that don't support -Playback mode as LiveOnly
Rerecord all recording files

* Minor updates for consistency
Rerecord all tests
Move 4 test files back to LiveOnly

* fix test cases

* Correct location handling, fix tests and consistency (#24573)

* Update to autorest 4.x
Update to Azure Policy 2023-04-01
Move to non-versioned interface types
Complete full test suite for existing cmdlets
Few bug fixes
Add completer for Location parameter
Fix record/playback, remove -LiveOnly tags
Make test names repeatable to work with record/playback
Implement resource group functions that became inaccessible
Fix test failures due to default parameter injection

* Clean up some transforms in README
Remove unsupported (for now) parameters
Streamline common test code
Move common test code to utils.ps1
Add serialization of test variables to env.json

* Remove extra parameters from Get-AzPolicyAssignment
Rerecord the tests

* Fix $testFilesFolder calculation to work on macOS/linux.

* Hide generated parameter sets for New-*
Correct definitions, validation, and tests for New-AzPolicyAssignment parameters
Re-record all tests

* Replace Get-AzContext with Utils\Get-SubscriptionIdTestSafe
Move to autorest 4.0.690
Update managed identity properties to match generation changes
Remove several parameter transforms no longer needed
Rerecord all tests
91 tests still failing on -Playback with the same signature

* Remove location completer from exports/docs/examples/help

* Improve location completer tests

* Remove transforms for Scope and Id parameters no longer needed
Update cmdlets to use Scope and Id directly
Rerecord all tests
All tests pass in -Record mode
Failures in -Playback mode unchanged

* Change location completer to lazy load (vs. module load)
Preserve "extra" input parameters in Update-* calls to Get-* in order to support -Playback test mode
Tag test files that don't support -Playback mode as LiveOnly
Rerecord all recording files

* Minor updates for consistency
Rerecord all tests
Move 4 test files back to LiveOnly

* Updates for consistency and to fix tests
Make changes to ensure consistent and valid handling of $location
Rerecord tests

* Fix bad merge
Rerecord two test files

* Re-record tests

* remove unnecessary script

* change cached location with a more unique name

* update execution of util script

* fix positional parameters generated when only default parameter set

* fix erroraction for Get-AzPolicyDefinition

* Apply feedback (#24757)

* Update to autorest 4.x
Update to Azure Policy 2023-04-01
Move to non-versioned interface types
Complete full test suite for existing cmdlets
Few bug fixes
Add completer for Location parameter
Fix record/playback, remove -LiveOnly tags
Make test names repeatable to work with record/playback
Implement resource group functions that became inaccessible
Fix test failures due to default parameter injection

* Clean up some transforms in README
Remove unsupported (for now) parameters
Streamline common test code
Move common test code to utils.ps1
Add serialization of test variables to env.json

* Remove extra parameters from Get-AzPolicyAssignment
Rerecord the tests

* Fix $testFilesFolder calculation to work on macOS/linux.

* Hide generated parameter sets for New-*
Correct definitions, validation, and tests for New-AzPolicyAssignment parameters
Re-record all tests

* Replace Get-AzContext with Utils\Get-SubscriptionIdTestSafe
Move to autorest 4.0.690
Update managed identity properties to match generation changes
Remove several parameter transforms no longer needed
Rerecord all tests
91 tests still failing on -Playback with the same signature

* Remove location completer from exports/docs/examples/help

* Improve location completer tests

* Remove transforms for Scope and Id parameters no longer needed
Update cmdlets to use Scope and Id directly
Rerecord all tests
All tests pass in -Record mode
Failures in -Playback mode unchanged

* Change location completer to lazy load (vs. module load)
Preserve "extra" input parameters in Update-* calls to Get-* in order to support -Playback test mode
Tag test files that don't support -Playback mode as LiveOnly
Rerecord all recording files

* Minor updates for consistency
Rerecord all tests
Move 4 test files back to LiveOnly

* Updates for consistency and to fix tests
Make changes to ensure consistent and valid handling of $location
Rerecord tests

* Fix bad merge
Rerecord two test files

* Re-record tests

* Implement feedback:
 - Add ResourceId to Get-AzPolicy[Set]Definition
 - Change -BuiltIn to -Builtin
 - Add -InputObject parameter to Update-* cmdlets
 - Control ErrorAction behavior for Get-AzPolicy[Set]Definition
Deprecate the -BackwardCompatible switch

* sync static analysis exceptions

* remove redundant

* added file accidentally removed

---------

Co-authored-by: Yabo Hu <[email protected]>
  • Loading branch information
mentat9 and VeryEarly authored May 8, 2024
1 parent c3604ec commit 5fd5f8a
Show file tree
Hide file tree
Showing 238 changed files with 103,578 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/EdgeZones/EdgeZones.Autorest/test/loadEnv.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) {
$env = @{}
if (Test-Path -Path $envFilePath) {
$env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json
$PSDefaultParameterValues=@{"*:SubscriptionId"=$env.SubscriptionId; "*:Tenant"=$env.Tenant}
$PSDefaultParameterValues=@{"*:Tenant"=$env.Tenant}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ function setupEnv() {
}
function cleanupEnv() {
# Clean resources you create for testing
}

}
1 change: 1 addition & 0 deletions src/Resources/Policy.Autorest/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
16 changes: 16 additions & 0 deletions src/Resources/Policy.Autorest/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
bin
obj
.vs
generated
internal
exports
tools
custom/*.psm1
custom/autogen-model-cmdlets
test/*-TestResults.xml
/*.ps1
/*.ps1xml
/*.psm1
/*.snk
/*.csproj
/*.nuspec
25 changes: 25 additions & 0 deletions src/Resources/Policy.Autorest/Az.Policy.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@{
GUID = '54d436a4-6f2e-4977-b339-2b40665fd8c4'
RootModule = './Az.Policy.psm1'
ModuleVersion = '0.1.1'
CompatiblePSEditions = 'Core', 'Desktop'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = 'Microsoft Corporation. All rights reserved.'
Description = 'Microsoft Azure PowerShell: Policy cmdlets'
PowerShellVersion = '5.1'
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.Policy.private.dll'
FormatsToProcess = './Az.Policy.format.ps1xml'
ScriptsToProcess = @('./custom/Helpers.ps1')
FunctionsToExport = 'Get-AzPolicyAssignment', 'Get-AzPolicyDefinition', 'Get-AzPolicyExemption', 'Get-AzPolicySetDefinition', 'New-AzPolicyAssignment', 'New-AzPolicyDefinition', 'New-AzPolicyExemption', 'New-AzPolicySetDefinition', 'Remove-AzPolicyAssignment', 'Remove-AzPolicyDefinition', 'Remove-AzPolicyExemption', 'Remove-AzPolicySetDefinition', 'Update-AzPolicyAssignment', 'Update-AzPolicyDefinition', 'Update-AzPolicyExemption', 'Update-AzPolicySetDefinition'
AliasesToExport = 'Set-AzPolicyAssignment', 'Set-AzPolicyDefinition', 'Set-AzPolicyExemption', 'Set-AzPolicySetDefinition'
PrivateData = @{
PSData = @{
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Policy'
LicenseUri = 'https://aka.ms/azps-license'
ProjectUri = 'https://github.com/Azure/azure-powershell'
ReleaseNotes = ''
}
}
}
25 changes: 25 additions & 0 deletions src/Resources/Policy.Autorest/Az.Policy.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.34003.232
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Az.Policy", "Az.Policy.csproj", "{E1516122-D175-4776-84D1-CFCC38F34A9C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E1516122-D175-4776-84D1-CFCC38F34A9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1516122-D175-4776-84D1-CFCC38F34A9C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1516122-D175-4776-84D1-CFCC38F34A9C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1516122-D175-4776-84D1-CFCC38F34A9C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9256CB53-1F25-4B11-9300-554991740A15}
EndGlobalSection
EndGlobal
262 changes: 262 additions & 0 deletions src/Resources/Policy.Autorest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
<!-- region Generated -->
# Az.Policy
This directory contains the PowerShell module for the Policy service.

---
## Info
- Modifiable: yes
- Generated: all
- Committed: yes
- Packaged: yes

---
## Detail
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.

## Module Requirements
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater

## Authentication
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.

## Development
For information on how to develop for `Az.Policy`, see [how-to.md](how-to.md).
<!-- endregion -->

### AutoRest Configuration
> see https://aka.ms/autorest
``` yaml
# Please specify the commit id that includes your features to make sure generated codes stable.
commit: 33da947dfea91e16a4e62c663a13de4f0fa72251
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
# You need to specify your swagger files here.
- $(repo)/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/policyDefinitions.json
- $(repo)/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/policySetDefinitions.json
- $(repo)/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/policyDefinitionVersions.json
- $(repo)/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/policySetDefinitionVersions.json
- $(repo)/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/policyAssignments.json
- $(repo)/specification/resources/resource-manager/Microsoft.Authorization/preview/2022-07-01-preview/policyExemptions.json
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
# - ..\..\..\..\azure-rest-api-specs\specification\resources\resource-manager\Microsoft.Authorization\stable\2023-04-01\policyDefinitionVersions.json
# - ..\..\..\..\azure-rest-api-specs\specification\resources\resource-manager\Microsoft.Authorization\stable\2023-04-01\policySetDefinitionVersions.json

# For new RP, the version is 0.1.1
module-version: 0.1.1
# Normally, title is the service name
root-module-name: $(prefix).Resources
title: Policy
subject-prefix: Policy

# If there are post APIs for some kinds of actions in the RP, you may need to
# uncomment following line to support viaIdentity for these post APIs
# identity-correction-for-post: true

# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
#use-extension:
# "@autorest/powershell": "3.x"
azure: true
resourcegroup-append: false
identity-correction-for-post: false
export-properties-for-dict: false
nested-object-to-string: false

directive:
# Following is two common directive which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
- where:
variant: ^Create$|^CreateViaIdentity.*$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
remove: true
# Remove the set-* cmdlet
- where:
verb: Set
remove: true
- where:
verb: New|Update
variant: ^(Create|Update)(?!.*?Expanded)
remove: true
# Remove ManagementGroupInputObject parameter for all cmdlets, since it's not supported
- where:
variant: ^(Get|Delete|Update)ViaIdentityManagementGroup(Expanded)?$
remove: true

# Hide separate cmdlets generated for tenant-level GETs. These are used by Get-AzPolicy*
# customization to match behavior of current SDK cmdlets.
- where:
subject: .*Built
hide: true

# Create aliases of Set-*, since they are not supported/generated by autorest.powershell
# They are provide in the new policy module for compatibility with current SDK module.
# Since neither definitions nor set definitions generate Update-* cmdlets, both
# Set-* and Update-* cmdlets are implemented by wrapping the generated New-* cmdlets.
- where:
verb: Update
subject: PolicyAssignment
set:
alias:
Set-AzPolicyAssignment
- where:
verb: Update
subject: PolicyExemption
set:
alias:
Set-AzPolicyExemption

# Hide generated ManagementGroupId parameter for all cmdlets
# since previous SDK cmdlets always used ManagementGroupName
- where:
parameter-name: ManagementGroupId
set:
default:
name: DefaultManagementGroupId
description: Need a placeholder to keep autorest happy
script: '{ "" }'
hide: true

# Hide extra parameters likely to be confusing in new cmdlets
- where:
verb: New
subject: PolicyExemption
parameter-name: PolicyAssignmentId
set:
default:
name: DefaultAssignmentId
description: Need a placeholder to keep autorest happy
script: '{ "" }'
hide: true

# Need to change ExpiresOn to a nullable DateTime (not supported by autorest)
- where:
verb: New
subject: PolicyExemption
parameter-name: ExpiresOn
set:
parameter-name: ExpiresOnInternal
default:
name: DefaultExpiresOn
description: Need a placeholder to keep autorest happy
script: '"PlaceholderExpiresOn"'
hide: true
clear-alias: true

# Transform empty object definitions (e.g. policyRule, metadata) so they are generated as
# hashtable, otherwise their values are discarded
- from: swagger-document
where: $.definitions.PolicyAssignmentProperties.properties.metadata
transform: $['additionalProperties'] = true
- from: swagger-document
where: $.definitions.PolicyDefinitionProperties.properties.policyRule
transform: $['additionalProperties'] = true
- from: swagger-document
where: $.definitions.PolicyDefinitionProperties.properties.metadata
transform: $['additionalProperties'] = true
- from: swagger-document
where: $.definitions.PolicySetDefinitionProperties.properties.metadata
transform: $['additionalProperties'] = true;
- from: swagger-document
where: $.definitions.PolicyExemptionProperties.properties.metadata
transform: $['additionalProperties'] = true;
- from: swagger-document
where: $.definitions.PolicySetDefinitionProperties.properties.policyDefinition.policyDefinitionId
transform: $['additionalProperties'] = true;
- from: swagger-document
where: $.definitions.PolicySetDefinitionProperties.properties.policyDefinition.parameters
transform: $['additionalProperties'] = true;
- from: swagger-document
where: $.definitions.PolicySetDefinitionProperties.properties.policyDefinition.policyDefinitionReferenceId
transform: $['additionalProperties'] = true;
- from: swagger-document
where: $.definitions.PolicySetDefinitionProperties.properties.policyDefinition.groupNames
transform: $['additionalProperties'] = true;

# previous approach that partially supported "any type" serialization
- from: swagger-document
where: $.definitions.ParameterDefinitionsValue.properties.allowedValues.items
transform: $['additionalProperties'] = true;
- from: swagger-document
where: $.definitions.ParameterDefinitionsValue.properties.defaultValue
transform: $['additionalProperties'] = true;
- from: swagger-document
where: $.definitions.ParameterValues
transform: $['additionalProperties'] = true;
- from: swagger-document
where: $.definitions.ParameterDefinitions
transform: $['additionalProperties'] = true;

# Rename generated hashtable parameters to avoid type mismatch, since generated code
# uses hashtable and previous SDK cmdlets use [JSON] string. Note, removing any
# of these will cause builds to fail, since a parameter is not allowed to be
# multiple types.
- where:
parameter-name: Metadata
set:
parameter-name: MetadataTable
hide: true
- where:
parameter-name: Parameter
set:
parameter-name: ParameterTable
hide: true
- where:
parameter-name: PolicyDefinition
set:
parameter-name: PolicyDefinitionTable
hide: true
- where:
parameter-name: PolicySetDefinition
set:
parameter-name: PolicySetDefinitionTable
hide: true
- where:
parameter-name: PolicyDefinitionGroup
set:
parameter-name: PolicyDefinitionGroupTable
hide: true
- where:
parameter-name: NonComplianceMessage
set:
parameter-name: NonComplianceMessageTable
hide: true

# Hide parameters that aren't supported.
# For some reason these can't be hidden by hiding them in
# the custom folder so we have to do it here.
- where:
verb: New|Update
subject: PolicyAssignment|PolicyExemption
parameter-name: PolicyDefinitionId|ResourceSelector|Override
hide: true
- where:
verb: New
subject: PolicyDefinition
parameter-name: PolicyRule
hide: true
- where:
verb: New|Update
subject: PolicyDefinition|PolicySetDefinition
parameter-name: Version|PropertiesVersions
hide: true
- where:
verb: Get
parameter-name: Top
hide: true

# Remove or hide cmdlets that are customized or not supported at all
- where:
verb: New|Get|Remove|Update
hide: true
- where:
verb: New|Remove|Update
subject: PolicyDefinitionVersion|PolicySetDefinitionVersion
remove: true

metadata:
scriptsToProcess:
- ./custom/Helpers.ps1

```
Loading

0 comments on commit 5fd5f8a

Please sign in to comment.