You must provide a value expression following the '-' operator.

i’m trying to splat some information for export purposes.

the entry is:
“Department” = $entry.USA_-CF-_Evaluate_Sup_Org_Name

when this runs i recieve:
At line:112 char:42

  •           "Department" = $entry.USA_-_CF_-_Evaluate_Sup_Org_Name
    
  •                                      ~
    

You must provide a value expression following the ‘-’ operator.

if i export the data that i am looping through, the header as shown above is the actual header.

i have tried ` the - signs :
“Department” = $entry.USA_`-CF`-_Evaluate_Sup_Org_Name

but receive this error then:
At line:112 char:42

  •           "Department" = $entry.USA_-_CF_-_Evaluate_Sup_Org_Name
    
  •                                      ~
    

You must provide a value expression following the ‘-’ operator.

completely stumped here, any assistance would be appreciated

Yeah, the problem is that dashes aren’t technically legal as property names. The parser is choking on it.

Try surrounding the property name in {curlies}, e.g., $variable.{This-is-not-great}.

You could also use double or single quotes.

$object = [pscustomobject]@{
    Name = "test"
    'USA_-_CF_-_Evaluate_Sup_Org_Name' = "some data"
}

$object.{USA_-_CF_-_Evaluate_Sup_Org_Name}
$object.'USA_-_CF_-_Evaluate_Sup_Org_Name'
$object."USA_-_CF_-_Evaluate_Sup_Org_Name"

Thanks Don, wrapping the property name in {} did the trick