'Powershell Get-AzkeyVault AccessPolicies not visible

This is a part of my code

$keyVaults = Get-AzkeyVault | Sort-Object VaultName

    foreach($keyVault in $keyVaults) {

        $kvName = $keyVault.VaultName
        $keyVault | Get-Member

This would result into $keyVault being a PSKeyVaultIdentityItem class, and the output shows

   TypeName: Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultIdentityItem

Name              MemberType Definition
----              ---------- ----------
Equals            Method     bool Equals(System.Object obj)
GetHashCode       Method     int GetHashCode()
GetType           Method     type GetType()
ToString          Method     string ToString()
Location          Property   string Location {get;set;}
ResourceGroupName Property   string ResourceGroupName {get;set;}
ResourceId        Property   string ResourceId {get;set;}
Tags              Property   hashtable Tags {get;set;}
TagsTable         Property   string TagsTable {get;}
VaultName         Property   string VaultName {get;set;}

But, where is my AccessPolicies property. When I do a count I'm getting 0, although in the portal I'm seeing several ...

Kr, Harry



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source