Methods

The methods available may be viewed in a number of ways. The URL used can be visited in a browser, or Get-Member may be used. A subset of the output from Get-Member follows:

PS> $service | Get-Member

Name MemberType Definition

---- ---------- ----------
GetElement Method SOAP.Element GetElement(string Name)
GetAtomicMass Method string GetAtomicMass(string Name)
GetAtomicNumber Method int GetAtomicNumber(string Name)
GetElements Method SOAP.Element[] GetElements()
GetElementsByGroup Method SOAP.Element[] GetElementsByGroup(SOAP.Group group)
GetElementSymbol Method string GetElementSymbol(string Name)
SearchElements Method SOAP.Element[] SearchElements(SOAP.SearchCondition[] searchConditions)

The preceding  GetElements method requires no arguments and may be called immediately, as shown here:

PS> $service.GetElements() | Select-Object -First 5 | Format-Table

AtomicNumber Symbol Name AtomicMass Group
------------ ------ ---- ---------- -----
1 H Hydrogen 1.00794(4) Nonmetal
2 He Helium 4.002602(2) NobleGas
3 Li Lithium 6.941(2) AlkaliMetal
4 Be Beryllium 9.012182(3) AlkalineEarthMetal
5 B Boron 10.811(7) Metalloid

Methods requiring string or numeric arguments may be similarly easy to call, although the value the method requires is often open to interpretation. In this case, the name argument may be either an element name or an element symbol. Documentation is difficult to replace when working with web services:

PS> $service.GetAtomicNumber('oxygen')
8


PS> $service.GetAtomicMass('H')
1.00794(4)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.172.252