header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

Cannnot get access to properties
Last Post 02 Jul 2008 02:08 PM by jonnyg. 2 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
jonnygUser is Offline
New Member
New Member
Posts:2
Avatar

--
02 Jul 2008 05:38 AM  

Hi

I'm sure this is obvious but I’m having difficulty getting access to the following properties in a System.Xml.XmlElement object.

#text                Property              System.String #text {get;set;}

and

keywords-utf8        Property              System.Xml.XmlElement keywords-utf8 {get;}

In both cases I get an error when I try to reference these properties one like this

"Missing property name after reference operator."

the other like this

"You must provide a value expression on the right-hand side of the '-' operator."

I guess in both cases this is because the property has a reserved character but I have tried escaping with the back tick with no luck

Any help would be great


Just adding the text below to help indexing

pound sign #

dash, minus sign -

 

bsonposhUser is Offline
Basic Member
Basic Member
Posts:393
Avatar

--
02 Jul 2008 01:44 PM  
try adding quotes and escaping the # and the -

$object."#text"
$object."keywords`-utf8"

I havent tested this.. just a suggestion
Brandon Shell
----------------
Microsoft Powershell MVP
https://mvp.support.microsoft.com/profile/Brandon
Blog: http://www.bsonposh.com
jonnygUser is Offline
New Member
New Member
Posts:2
Avatar

--
02 Jul 2008 02:08 PM  

thanks just adding the quotes worked like this

$object."#text"

and

$object."keywords-utf8"

You are not authorized to post a reply.

Active Forums 4.1
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer