I have this object in Powershell which I obtained from a query against the SSRS Web Service:
$ds|gm
TypeName: Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy3tServer_ReportService2010_asmx.DataSource
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
Item Property Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy3tServer_ReportService2010_asmx.DataSourceDe...
Name Property string Name {get;set;}
If I list the $ds object:
$ds|fl
Name : AHPUsersData
Item : Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy3tServer_ReportService2010_asmx.DataSourceReference
What I need is the value of "Item" which actually appears to be the type of an object stored in "Item". I've try assigning $ds.Item to a new object but it just turns into a Powershell custom object and all that info goes away. I've tried various combinations of GetType with no success. Ultimately what I need is the last part of:
Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy3tServer_ReportService2010_asmx.DataSourceReference
Which is the "DataSourceReference" string. This part can have two values, "DataSourceReference" or "DataSourceDefinition" and I need to test that to determine the code to execute next.
Relative newbie to Powershell and this one is a bit obtuse for me. Any help is greatly appreciated.
$ds | select -expand Itemreturn?