GED125
GED125

Reputation: 496

How do I deal with dashes in a property name in powershell

I am trying to write the Active Directory parameter msRTCSIP-PrimaryUserAddress to a variable in powershell. For some reason, it seems to be choking on the dash in the property name. Does anyone know a way around it? I was able put other property in the variable that do not have a dash.

$sip = $sipaccount.msRTCSIP-PrimaryUserAddress

Anyone ever run into this? Know of a way around it?

Upvotes: 4

Views: 3290

Answers (1)

Chad Baldwin
Chad Baldwin

Reputation: 2602

You can put it in quotes like so:

$sip = $sipaccount.'msRTCSIP-PrimaryUserAddress'

Upvotes: 9

Related Questions