Hey Y’all,
Just came across something new and I can’t seem to find the correct google query to tell me what it is.
Here’s the output of the Get-Member cmdlet on my vairable that contains an object:
TypeName: System.Xml.XmlElement#http://schemas.microsoft.com/windows/2004/02/mit/task#URI Name MemberType Definition ---- ---------- ---------- ToString CodeMethod static string XmlNode(psobject in... AppendChild Method System.Xml.XmlNode AppendChild(Sy... Clone Method System.Xml.XmlNode Clone(), Syste... CloneNode Method System.Xml.XmlNode CloneNode(bool... CreateNavigator Method System.Xml.XPath.XPathNavigator C... Equals Method bool Equals(System.Object obj) GetAttribute Method string GetAttribute(string name),... GetAttributeNode Method System.Xml.XmlAttribute GetAttrib... GetElementsByTagName Method System.Xml.XmlNodeList GetElement... GetEnumerator Method System.Collections.IEnumerator Ge... GetHashCode Method int GetHashCode() GetNamespaceOfPrefix Method string GetNamespaceOfPrefix(strin... GetPrefixOfNamespace Method string GetPrefixOfNamespace(strin... GetType Method type GetType() HasAttribute Method bool HasAttribute(string name), b... InsertAfter Method System.Xml.XmlNode InsertAfter(Sy... InsertBefore Method System.Xml.XmlNode InsertBefore(S... Normalize Method void Normalize() PrependChild Method System.Xml.XmlNode PrependChild(S... RemoveAll Method void RemoveAll() RemoveAllAttributes Method void RemoveAllAttributes() RemoveAttribute Method void RemoveAttribute(string name)... RemoveAttributeAt Method System.Xml.XmlNode RemoveAttribut... RemoveAttributeNode Method System.Xml.XmlAttribute RemoveAtt... RemoveChild Method System.Xml.XmlNode RemoveChild(Sy... ReplaceChild Method System.Xml.XmlNode ReplaceChild(S... SelectNodes Method System.Xml.XmlNodeList SelectNode... SelectSingleNode Method System.Xml.XmlNode SelectSingleNo... SetAttribute Method void SetAttribute(string name, st... SetAttributeNode Method System.Xml.XmlAttribute SetAttrib... Supports Method bool Supports(string feature, str... WriteContentTo Method void WriteContentTo(System.Xml.Xm... WriteTo Method void WriteTo(System.Xml.XmlWriter w) Item ParameterizedProperty System.Xml.XmlElement Item(string... [SIZE=3][COLOR=#0000ff]#text Property string #text {get;set;} [/COLOR][/SIZE]
So how do I retrieve the value in #text. I get syntax errors if I try to use the standard . reference, e.g. $TaskName.#text.
PS> $TaskName #text ----- RegEdit as Admin PS> $TaskName.#text Missing property name after reference operator. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordEx ception + FullyQualifiedErrorId : MissingPropertyName
I’ve googled but can’t seem to fine the necessary reference.
:cheers: