-
Notifications
You must be signed in to change notification settings - Fork 4.1k
PolicyInsights RP GA version of cmdlets #6375
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
937c683
Fix bug in help text for To parameter
bulentelmaci bfa6d75
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
bulentelmaci a709a17
Upgrade PolicyInsights package to latest; test changes (needs new rec…
bulentelmaci 58e63dd
Version change; release notes and change log
bulentelmaci 943c40e
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
bulentelmaci 34b9da7
Update assembly and help versions as well
bulentelmaci 9042bf8
Update test project; update test scripts to get hardcoded resource na…
bulentelmaci 99e52ce
Minor fix
bulentelmaci b86e238
Add format for PolicyDefinitionReferenceId
bulentelmaci 65c7cd2
Regenerate MDs using platyPS
bulentelmaci a45a85d
Fix common function
bulentelmaci 0e964ee
More test validation fixes
bulentelmaci 73ede6d
Recorded new tests with some changed resource names; minor fixes to v…
bulentelmaci 14f673c
Recorded tests again with changes to resource names for policy defini…
bulentelmaci 1c93e69
Remove version number from changelog
bulentelmaci c11b547
Remove references/packages that come from common dependencies; add us…
bulentelmaci fb747c4
Merge branch 'preview' into preview
MiYanni 7c1345f
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
bulentelmaci 5280973
Merge branch 'preview' of https://github.com/bulentelmaci/azure-power…
bulentelmaci c7e05a4
Fix the dependency version and metadata for netcore
bulentelmaci 325c523
Change package version in netcore test project as well; add policy in…
bulentelmaci 1f7606b
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
bulentelmaci 34eb29a
Use string.IsNullOrEmpty instead
bulentelmaci d120a3d
Merge branch 'preview' into preview
bulentelmaci File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,114 @@ | |
| # limitations under the License. | ||
| # ---------------------------------------------------------------------------------- | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Gets test management group name | ||
| #> | ||
| function Get-TestManagementGroupName | ||
| { | ||
| "azgovtest4" | ||
| } | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Gets test resource group group name | ||
| #> | ||
| function Get-TestResourceGroupName | ||
| { | ||
| "bulenttestrg" | ||
| } | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Gets test resource id | ||
| #> | ||
| function Get-TestResourceId | ||
| { | ||
| "/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourcegroups/govintpolicyrp/providers/microsoft.network/trafficmanagerprofiles/gov-int-policy-rp" | ||
| } | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Gets test policy set definition name | ||
| #> | ||
| function Get-TestPolicySetDefinitionName | ||
| { | ||
| "12b58873-e0f8-4b95-936c-86cbe7c9d697" | ||
| } | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Gets test policy definition name | ||
| #> | ||
| function Get-TestPolicyDefinitionName | ||
| { | ||
| "24813039-7534-408a-9842-eb99f45721b1" | ||
| } | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Gets test policy assignment name | ||
| #> | ||
| function Get-TestPolicyAssignmentName | ||
| { | ||
| "45ab2ab7898d45ebb3087573" | ||
| } | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Gets test resource group group name for resource group level policy assignment (for event tests) | ||
| #> | ||
| function Get-TestResourceGroupNameForPolicyAssignmentEvents | ||
| { | ||
| "jilimpolicytest2" | ||
| } | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Gets test policy assignment name (resource group level) (for event tests) | ||
| #> | ||
| function Get-TestPolicyAssignmentNameResourceGroupLevelEvents | ||
| { | ||
| "e9860612d8ec4a469f59af06" | ||
| } | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Gets test resource group group name for resource group level policy assignment (for state tests) | ||
| #> | ||
| function Get-TestResourceGroupNameForPolicyAssignmentStates | ||
| { | ||
| "bulenttestrg" | ||
| } | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Gets test policy assignment name (resource group level) (for state tests) | ||
| #> | ||
| function Get-TestPolicyAssignmentNameResourceGroupLevelStates | ||
| { | ||
| "f4d1645d-9180-4968-99df-17234d0f7019" | ||
| } | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Gets test query interval start | ||
| #> | ||
| function Get-TestQueryIntervalStart | ||
| { | ||
| "2018-03-31 00:00:00Z" | ||
| } | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Gets test query interval end | ||
| #> | ||
| function Get-TestQueryIntervalEnd | ||
| { | ||
| "2018-05-30 00:00:00Z" | ||
| } | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Validates a list of policy events | ||
|
|
@@ -20,7 +128,8 @@ function Validate-PolicyEvents | |
| { | ||
| param([System.Collections.Generic.List`1[[Microsoft.Azure.Commands.PolicyInsights.Models.PolicyEvent]]]$policyEvents, [int]$count) | ||
|
|
||
| Assert-AreEqual $count $policyEvents.Count | ||
| Assert-True { $count -ge $policyEvents.Count } | ||
| Assert-True { $policyEvents.Count -gt 0 } | ||
| Foreach($policyEvent in $policyEvents) | ||
| { | ||
| Validate-PolicyEvent $policyEvent | ||
|
|
@@ -56,7 +165,8 @@ function Validate-PolicyStates | |
| { | ||
| param([System.Collections.Generic.List`1[[Microsoft.Azure.Commands.PolicyInsights.Models.PolicyState]]]$policyStates, [int]$count) | ||
|
|
||
| Assert-AreEqual $count $policyStates.Count | ||
| Assert-True { $count -ge $policyStates.Count } | ||
| Assert-True { $policyStates.Count -gt 0 } | ||
| Foreach($policyState in $policyStates) | ||
| { | ||
| Validate-PolicyState $policyState | ||
|
|
@@ -97,7 +207,8 @@ function Validate-PolicyStateSummary | |
| Assert-NotNull $policyStateSummary.Results.NonCompliantPolicies | ||
|
|
||
| Assert-NotNull $policyStateSummary.PolicyAssignments | ||
| Assert-AreEqual $policyStateSummary.PolicyAssignments.Count $policyStateSummary.Results.NonCompliantPolicies | ||
| Assert-True { $policyStateSummary.PolicyAssignments.Count -le $policyStateSummary.Results.NonCompliantPolicies } | ||
| Assert-True { $policyStateSummary.PolicyAssignments.Count -gt 0 } | ||
|
|
||
| Foreach($policyAssignmentSummary in $policyStateSummary.PolicyAssignments) | ||
| { | ||
|
|
@@ -110,7 +221,8 @@ function Validate-PolicyStateSummary | |
| Assert-NotNull $policyAssignmentSummary.Results.NonCompliantPolicies | ||
|
|
||
| Assert-NotNull $policyAssignmentSummary.PolicyDefinitions | ||
| Assert-AreEqual $policyAssignmentSummary.PolicyDefinitions.Count $policyAssignmentSummary.Results.NonCompliantPolicies | ||
| Assert-True { $policyAssignmentSummary.PolicyDefinitions.Count -eq $policyAssignmentSummary.Results.NonCompliantPolicies } | ||
| Assert-True { $policyAssignmentSummary.PolicyDefinitions.Count -gt 0 } | ||
|
|
||
| if ($policyAssignmentSummary.Results.NonCompliantPolicies -gt 1) | ||
| { | ||
|
|
@@ -140,5 +252,5 @@ function Assert-NotNullOrEmpty | |
| param([string]$value) | ||
|
|
||
| Assert-NotNull $value | ||
| Assert-AreNotEqual $value "" | ||
| Assert-True { $value -ne "" } | ||
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Microsoft.Rest.ClientRuntime, Microsoft.Rest.ClientRuntime.Azure and Newtonsoft.Json shouldn't be in the .csproj or packages.config files since they are referenced elsewhere.
For example, every .csproj file should have a reference to the following file at the bottom of their file
Here's an example of a .csproj file referencing this file