Mg Beta: Entitlement Management -Answers Switch Fix
A quick post for those who are are trying to use the CMDlet New-MgBetaEntitlementManagementAccessPackageAssignmentRequest.
If you have wondered how the anwsers input values should look like this should help. It is Beta but might help until the doco is updated. - See more below.
Joshua Bines
$answers = @(
@{
"@odata.type" = "#microsoft.graph.accessPackageAnswerString"
value = "The answer to the question"
answeredQuestion = @{
"@odata.type" = "#microsoft.graph.accessPackageTextInputQuestion"
id = "$questionId"
}
}
)
New-MgBetaEntitlementManagementAccessPackageAssignmentRequest -RequestType 'AdminAdd' -AccessPackageId $accessPackageId -AssignmentPolicyId $accesPackagePolicyId -TargetEmail $userEmail -Answers $answers