none
cmdlet with Multiple output objects RRS feed

  • Question

  • Hi,

     

    I'm building a script that uses the PS4.0 cmdlet: Test-Cluster.

    In the documentation ( http://technet.microsoft.com/en-us/library/hh847274.aspx ) 
    I found that it has 2 output objects;

    • System.IO.FileInfo
    • Microsoft.FailoverClusters.PowerShell.ClusterTestInfo

    Now I run the cmdlet and put the output in a variable

    $result = Test-Cluster

    I do a get-member on the result; 

    $result | Get-Member

    I get typename; System.IO.FileInfo

     

    How do I access the Microsoft.FailoverClusters.PowerShell.ClusterTestInfo object?

     

    Thanks in advance,

    /S


    Tuesday, February 25, 2014 9:40 AM

Answers

  • Hi Sander,

    reading the documentation, I'd wager you get the ClusterTestInfo by setting the "-List" switch.

    Cheers,
    Fred


    There's no place like 127.0.0.1

    • Marked as answer by sander.kl Tuesday, February 25, 2014 12:44 PM
    Tuesday, February 25, 2014 12:30 PM

All replies

  • Hi Sander,

    reading the documentation, I'd wager you get the ClusterTestInfo by setting the "-List" switch.

    Cheers,
    Fred


    There's no place like 127.0.0.1

    • Marked as answer by sander.kl Tuesday, February 25, 2014 12:44 PM
    Tuesday, February 25, 2014 12:30 PM
  • I hoped Microsoft.FailoverClusters.PowerShell.ClusterTestInfo contained test-cluster result info instead of a list of tests.

    Turns out the test-cluster cmdlet does not return a result object and is not suitable to use in a script.

    thanks Fred for your answer!

    /S

    Monday, March 3, 2014 10:12 AM
  • Hi Sander,

    you're quite welcome. However, I have to disagree with its lack of suitability for scripting. Having it only give its output into a file may be a bit unwieldy, but reading the content of a file is not exactly the most challenging task in Powershell. I don't have a cluster at hand to test it myself, but depending on just how that report is generated it may well be possible to retrieve the information and turn them into objects.

    Cheers,
    Fred


    There's no place like 127.0.0.1

    Monday, March 3, 2014 10:49 AM