DCCOR Exam QuestionsBrowse all questions from this exam

DCCOR Exam - Question 508


Refer to the exhibit.

A DevOps engineer must create a PowerShell script to display a list of tenants in the Cisco Application Centric Infrastructure (ACI) by using the Cisco ACI PowerShell module. The engineer does NOT know how many results will be returned, so it is important to iterate through all the results.

Which code snippet completes the script?

Show Answer
Correct Answer:

Discussion

1 comment
Sign in to comment
DSAM9Option: A
Feb 8, 2025

A looks ok powershell # Assume $resultjson contains the JSON response from the ACI API foreach( $tenant in $resultjson.imdata ) { $tenantName = $tenant.fvTenant.attributes.name Write-Host $tenantName } This code snippet does the following: It uses a foreach loop to iterate through each tenant in the imdata array. For each tenant, it extracts the tenant's name from the fvTenant.attributes.name property. It then prints the tenant's name using Write-Host.