MrFlinstone Thanks for reaching out. The process you are following is correct. However, I will share an example of how I retrieved the mentioned information in my environment for your reference.
In my example, I am retrieving the Policy Initiative "Enable Azure Monitor for VMSS with Azure Monitoring Agent(AMA)".
$mgmtGroup="Non Production" $policySetName="Audit Public Network Access"
$definition = Get-AzPolicySetDefinition -ManagementGroupName $mgmtGroup | Where {$_.Properties.DisplayName -eq $policySetName }
You can the internal name of the policy set definition using below command which is what you have been using.
Get-AzPolicySetDefinition -ManagementGroupName $mgmtGroup | Where {$_.Properties.DisplayName -eq
$policySetName } | Select-Object Name
To display all the values of property object within policy set definition, you can either follow the process shown in above screenshot or execute below command.
( Get-AzPolicySetDefinition -ManagementGroupName $mgmtGroup | Where {$_.Properties.DisplayName -eq $policySetName }).Properties
Regarding second error where you are prompted with Name not found , kindly share further information on the error by adding -debug property to command as I wasn't able to reproduce the error you are facing even though I am using similar commands as you.
$rg = Get-AzResourceGroup -Name "amkiyu"
New-AzPolicyAssignment -Name "audit PNA" -Scope $rg.ResourceId -PolicySetDefinition $definition