The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December.
Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
Hi everyone,
I'm still wrapping my head around using powershell and APIs I've managed to set up this
for ( $i_p = 1 ; $i_p -lt 44 ; $i_p += 1 ){
$courses = ((Invoke-WebRequest -Headers $headers -Uri "$uri/accounts/1/courses?include[]=teachers&per_page=100&sort=sis_course_id&page=$i_p").content )| convertfrom-json | Where {($courses.name -inotlike "*Template*" -and $courses.name -inotlike "*Sandbox")}
Foreach ($course in $courses) {
$teachername = $course | Select-Object -ExpandProperty teachers
$coursesdata = $courses | Select-Object -Property Name, sis_course_id, id,
@{ label = "Teacher"; expression = {$teachername.display_name} }
$coursesdata | Format-List}
}
Which returns a nicely formatted list of Course names, SIS ID's, ID's and Teacher Names for me, but I want to add in an Audit api so I can tell if a course has been worked on.
I know I need to run
$c_audit = ((Invoke-WebRequest -Headers $headers -Uri "$uri/audit/course/courses/$_.json").content | convertfrom-json)
$n_audit = ($c_audit.events).count
But I can;t figure out how to get the $courses.id to insert into the formula, or how to make it list the resultant event count in the same order I have collected the $coursedata.
Does anyone have any ideas?
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in