So I'm able to connect to an API and generate items based on a template from that data. But what is stumping me is the ability to get a child JSON element of one that contains a colon.
For example the code below is what I have currently:
$parentPath = Get-Item -Path "master:\" -ID "{2EDC48D0-6134-48DB-B103-DE6F4103B8EE}"
$Faculty_TemplateID = "{E2524ACD-C438-4263-9088-3EFBACB8CD9E}"
$items = Invoke-RestMethod -uri "*API URL*"
foreach($f in $items){
$faculty_firstName = $f.leadership_checkbox.first_name
$faculty_lastName = $f.leadership_checkbox.last_name
$faculty_position = $f.leadership_checkbox.title
#creating of the item
$faculty_item = New-Item -Parent $parentPath -Name $faculty_title -ItemType $Faculty_TemplateID
#setting field values on the created items
$faculty_item.Editing.BeginEdit()
$faculty_item.Fields["Title"].Value = $faculty_title
$faculty_item.Fields["First Name"].Value = $faculty_firstName
$faculty_item.Fields["Last Name"].Value = $faculty_lastName
$faculty_item.Editing.EndEdit()
}
Where the code is setting the variables, I'd like to add another one
$faculty_firstName = $f.leadership_checkbox.first_name
$faculty_lastName = $f.leadership_checkbox.last_name
$faculty_position = $f.leadership_checkbox.title
#NEW ONE
$faculty_info = $f.leadership_checkbox.wp:someImportantInfo
Powershell throws an "Unexpected Token" error when I try to do this like normal. I've tried things like Join-Path but nothing I've found seems to be working. Any Ideas?