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

feat: Return an object with an empty list property when KV does not exist #167

Merged

Conversation

fgheysels
Copy link
Member

When the Get-AzKeyVaultAccesspolicies is run against a non existing KV, make sure that the returned object contains a list property which is empty.
By doing so, the return type is consistent with what we get back when the KV does exist.

#166

$armAccessPolicies = @()
$keyVaultAccessPolicies = $keyVault.accessPolicies
$armAccessPolicies = @()
$keyVaultAccessPolicies = $keyVault.accessPolicies
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any specific reason why you're setting the $keyVaultAccessPolicies-variable outside of the if-statement?
This will only be used within that statement and will remain empty when the $keyVault-variable remains null.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, should indeed be put inside the if. I'll change that.

@mbraekman mbraekman changed the title Return an object with an empty list property when KV does not exist feat: Return an object with an empty list property when KV does not exist Apr 27, 2021
@mbraekman mbraekman merged commit 31994af into arcus-azure:master Apr 27, 2021
@fgheysels fgheysels deleted the frgh/fix/166_kv_accesspolicies branch October 19, 2021 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants