How to get the results in one line

Hi
if i use the script below i get the name of path and then : and in next line i get the results.is there a way to get the results from every path after the : and not in the next line?
another question - is there a way that the script will not show the server name on every path?
(Get-Counter -ListSet LogicalDisk).PathsWithInstances | Get-Counter
THC

If you take you script and pipe it to get member, it will give you a list of various script properties.
(Get-Counter -ListSet LogicalDisk).PathsWithInstances | Get-Counter | get-member
You will see that the object type returned by "Get-Counter" is Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSampleSet.
TypeName:
Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSampleSet
Name MemberType Definition
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
CounterSamples Property Microsoft.PowerShell.Commands.GetCounter.Perfo...
Timestamp Property datetime Timestamp {get;set;}
Readings ScriptProperty System.Object Readings {get=$strPaths = ""...
You can try grabbing different properties, and they will print out differently, displaying the data on the same line in some cases. For example, pipe your output to a "foreach-object" block, and then for each object print out the CounterSamples property.
(Get-Counter -ListSet LogicalDisk).PathsWithInstances | Get-Counter | foreach-object { ($_).CounterSamples }
This should all print on one line now. However, you also asked if there was a way to not have the server print out on every line. The way to control the format of these outputs is to use the "format-table" cmdlet. So you would pipe your output to format-table
and then give it various options. This is how you would pipe it (without any options).
(Get-Counter -ListSet LogicalDisk).PathsWithInstances |
Get-Counter | object { ($_).CounterSamples | format-table }#OR USE YOUR ORIGINAL CODE(Get-Counter -ListSet LogicalDisk).PathsWithInstances |
Get-Counter | format-table }
Now, it's up to you to give format-table the options you want. With no options, output will look unchanged. To see what options are available to you, use get-help.
get-help format-table
I hope this helps!
Thank for all the info...

Similar Messages

  • How to get the results for given Bind Variable

    Hi
    Can any one help me how to get the result rows from the View Object after executing the view object query by setting bind variable?
    snippet as follows
    viewObject.setNamedWherClauseParams("name","hei");
    viewObject.executeQuery();
    How to get the results from viewObject is my question..?
    Thanks in advance

    Should be something like
    while (vo.hasNext()){
    Row r = vo.next();
    r.getAttribute....
    You might want to read the "most commonly used methods" appendix in the ADF Developer Guide.

  • Call function in background task... How to get the result?

    I want to use Call function in background task parameter.
    But I cannot find the result of this function. (No export parameter, no table result, no exception)
    How to get the result of this function module? Correct or not?

    Hi Heinz,
    You can check the result in SM58 transaction.
    For more information pls. refer this thread :
    No IMPORTING parameters allowed in CALL FUNCTION IN BACKGROUND TASK
    Best regards,
    Prashant

  • Af:query - How to get the result rowsets

    Hi,
    I have a requirement where i need to search the db rows on and append the results the adf rich table on each search.
    For this i am using af:query component. And trying to get the result rows for the named criteria.
    String mexpr = "#{bindings.DestinDescVOCriteriaQuery.processQuery}";
    processMethodExpression(mexpr, queryEvent, QueryEvent.class);
    ViewCriteriaManager vcm = getDestinDescViewObj().getViewCriteriaManager();
    ViewCriteria vc = vcm.getViewCriteria("DestinDescVOCriteria");
    getDestinDescViewObj().applyViewCriteria(vc);
    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
    adfFacesContext.addPartialTarget(tblDestinDesc);
    However on each click of search the rows searched in the previous attempt are not retained.
    Can anyone let me know how to get the result from named criteria and append it the table?
    Thanks
    Ajay

    Can anyone help?

  • How can i do with labview program,when i have 20 different values,and 1 want to add it with constant value.and how to get the results?

    how can i do with labview program,when i have   20 different values,and 1 want to add it with constant value.and how to get the results?

    Why do the 20 values have to be different? The same code should work even if some are equal.
    What do you mean by "get the result"? The result is available at the output terminal and all you need is a wire to get it where you need it. That could be an indicator, another operation, or even a hardware device.
    What is the data type of the 20 values? An array? A cluster? A bunch of scalars? A waveform? Dynamic data?
    LabVIEW Champion . Do more with less code and in less time .

  • How to get the value in one JSP page to another?

    Hi,
    I have problems in passing the value around in JSP. I have two JSP pages as below:
    test1.jsp
    I try to get the vaule from my textbox by using:
    String strUser = request.getParameter ("strUserName");
    Then i print out by using: out.print(strUser); then i can get the value and put on my page (For example, i get ABC on my page).
    test2.jsp
    Next, i want to get the value from strUser (which mean that the one i already display on page in test1.jsp, ABC) to insert into my table by using INSERT INTO statement. Then i try by using
    String strUser1 = request.getParameter ("strUser");
    Is it possbile for me to do that? I cannot get anything to insert into my table. Then i tried out.print(strUser1); then i found that i get NULL value.
    Could you please give me some guidance?
    Thanks you very much for any advise you may give me.
    Kimsan

    Hi,
    Thank you very much for your help. It's working fine if i just get a one value to another page, however, i have problem while i pass the value in my loop to another page because i always get the last record. I try with the following code:
    logged_page.jsp
    <html>
    <head>
    <title>Welcome to the online Auction...</title></head>
    <body>
    <%@ page language ="java" import = "java.io.*, java.lang.*, java.sql.*" %>
    <% try
         String strUsername = request.getParameter("username");
         session.setAttribute("myUserName", strUsername);     
         String strPassword = request.getParameter("password");
         Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection myConn = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/Auction/Auction.mdb");
         String strSQL = "SELECT [UserName], [Password] FROM tblUserDetails where [UserName] = ? and [Password] = ?";
         PreparedStatement statement = myConn.prepareStatement(strSQL);
         statement.setString(1, strUsername);
         statement.setString(2, strPassword);
         ResultSet myResult = statement.executeQuery();
         if(myResult.next())
         //out.println("Login Succesful! A record with the given user name and password exists");
         out.print("<center><h1>");
         out.print("Welcome  ");
         out.print(strUsername);
         out.print("</h1></center>");
         out.print("<center>");
         out.print("<BR><BR>");
         out.print("<font font face = Viner Hand ITC size= 5>Products on sales</font>");
         out.print("<BR><BR>");
         Statement myStatement = myConn.createStatement ();
         ResultSet myResult1 = myStatement.executeQuery("SELECT * FROM tblProduct");
         ResultSetMetaData myResultSet = myResult1.getMetaData();
         out.println("<font face=Tahoma>");
         out.print("<table border=1 CELLSPACING=0>");
         out.print("<TR>");
         out.print("<TD width = 200> Item Title");out.print("</TD>");
         out.print("<TD width = 200> Description");out.print("</TD>");
         out.print("<TD width = 200> Current bid");out.print("</TD>");
         out.print("<TD width = 200> Available Time");out.print("</TD>");
         out.print("<TD width = 200> Place Bid");out.print("</TD>");
         out.print("</TR>");
         out.print("</table>");
         while(myResult1.next())
              String strProName = myResult1.getString(1);
              session.setAttribute("myProName", strProName);          
              out.print("<table border=1 CELLSPACING=0>");
              out.print("<TR>");
              out.print("<TD width = 200>");
              out.println(strProName);
              out.print("</TD>");
              out.print("<TD width = 200>");
              out.println(myResult1.getString(3));
              out.print("</TD>");
              out.print("<TD width = 200>");
              out.println(myResult1.getString(2));
              out.print("</TD>");
              out.print("<TD width = 200>");
              out.println(myResult1.getString(4));
         out.print("</TD>");
         out.print("<TD>");
              out.print("<form action=bid_page.jsp method=post>");
              out.print("<input type=text name=place_bid>");
              out.print("<input type=submit name=okfunc value=Bid>");
              out.print("</TD>");
              out.print("</form>");
              out.print("</TR>");
              out.print("</table>");
              out.println("</font>");
              out.print("</center>");          
         else
              out.print("<center>");
              out.print("Sorry ");
              out.print("<font color = RED size = 5>");
              out.print(strUsername);
              out.print("</font>");
              out.print(" could not be found.");
              out.print("</center>");
         myResult.close();
         statement.close();
         myConn.close();
         catch(SQLException e)
         out.println(e);
    %>
    </body>
    </html>
    bid_page.jsp
    <HTML>
    <HEAD>
    <TITLE>Welcome to the online Auction...</TITLE>
    </HEAD>
    <BODY>
    <%@ page language ="java" import = "java.io.*" import = "java.lang.*" import = "java.sql.*" %>
    <% try
         String thisUserName = (String) session.getAttribute("myUserName");
         String thisProName = (String) session.getAttribute("myProName");
              Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection myConn = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/Auction/Auction.mdb");
         PreparedStatement myStatement = myConn.prepareStatement("INSERT INTO tblHistory VALUES ('"+thisUserName+"', '"+thisProName+"', '"+request.getParameter("place_bid")+"')");
              myStatement.executeUpdate();
              myConn.commit();
              myStatement.close();
              myConn.close();
              catch(Exception e){}
    %>
    </BODY>
    </HTML>
    When i click on the BID button in the logged_page.jsp then i always get the last record and save into my table and that is not what i want to. i want to get the result on the same row as the BID button that just click and save to my table.
    Could you please advise?
    Thanks you very much for your time and any consideration you may give me.
    Best Regard,
    Kimsan

  • How to get the resulting XML as string

    Hello,
    I think my question is very simple but i'm new in this area.
    What i'm try to do is to parse a XML document with the DOM parser. Then i manipulate the DOM tree. After finishing the process i want to get the resulting XML document as an InputStream to give to another application for storing back into the database.
    Until know i print the resulting XML to System.out or I write it to a file.
    Do you know where i can find more information about this? Sample code??
    Thanks!

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jinyu Wang ([email protected]):
    You can try following code. It is not the simplest way, but it works for me:
    // Print to temp buffer
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream output = new DataOutputStream(baos);
    Xml_doc.print(output);
    String outtemp=baos.toString();
    System.out.println(outtemp);
    include following line for the lib:
    import java.io.*;<HR></BLOCKQUOTE>
    Many thanks for the reply. It works!

  • How to get the Organizational Unit One level up

    Hi
    Does any one know any function module to get the org unit one level up by giving the current Organizational unit as input. Please reply very urgent.

    Hello Nirmal
    I am usually using the following function module to read to OM:
    *   SAP_SORG
    * OrgStructure with assigned orgunits)
        REFRESH: lt_struc.
        CALL FUNCTION 'RHPH_STRUCTURE_READ'
          EXPORTING
            plvar             = '01'            " active Planvar.
            otype             = 'O'             " OrgUnit
            objid             = l_wa_cb1-objid  " Toplevel-Node
            wegid             = 'SAP_SORG'
            begda             = iw_begda
            endda             = iw_endda
            pup_info          = 'X'
            with_stext        = 'X'
            tdepth            = 0               " alle Sub-Levels
          TABLES
            stru_tab          = lt_struc
          EXCEPTIONS
            catalogue_problem = 1
            root_not_found    = 2
            wegid_not_found   = 3.
    The parameter <b>WEGID</b> is the crucial on which determines the objects that are read from the OM. In your case you will need <b>WEGID = 'A002'</b> (reports (line) to).
    To understand the <i>evaluation path</i> (WEGID) better have a look at transaction <b>PPST</b>.
    Regards
      Uwe

  • DbGetQuery = How to get the results to display?

    I am using the following
    sqldata <- dbGetQuery(con," select sysdate from dual")
    How do I get the result to display?
    summary(sqldata) displays the values
    if I do dbSendQuery then fetch show the results
    help(dbSendQuery) and help(dbGetQuery) go to the same page! dbSendQuery
    The documentation says dbGetQuery will connect, get the records and clear; maybe the clear happens before the display?!

    Hello Amin,
    Here is the way to display the result from the query you provided:
    Assign the result of the query to object 'sqldata':
    R> sqldata <- dbGetQuery(con," select sysdate from dual")
    Type the object name at the R prompt:
    R> sqldata
                  SYSDATE
    1 2014-04-28 14:45:14
    Sherry

  • How to make the result showing one time and make the result to csv file?

    My script having problem of showing out all the AD computer name result  from Active Directory once when running it and storing the result to csv file. I am a newbie in AD and powershell.
    This is the code:
    $strADPathFile = "D:\Powershell for AD\ADPathList.txt"
    $strErrLogFile = "D:\powershell for AD\errorADComputer.log"
    $arrADPath = Get-Content -Path $strADPathFile
    foreach ($strADPath in $arrADPath)
    try
    $objSearch = New-Object DirectoryServices.DirectorySearcher
    $objSearch.Filter = '(objectCategory=computer)'
    $objSearch.SearchRoot = $strADPath
    $objSearch.SearchScope = "Subtree"
    $objSearch.PageSize = 1000
    $objResults = $objSearch.Findall()
    write-host "Retrieving AD computer information in the domain $strDomain"
    write-host "Number of AD Computer Name result: "$objResults.Count
    foreach($objResult in $objResults){
    $objComputer = $objResult.GetDirectoryEntry()
    write-host $objComputer.dNSHostName
    try
    # InsertSQLTable $objComputer
    catch
    write-host $error[0]
    $strError = $objComputer.dNSHostName + " " + $dateNow + $error[0]
    Add-Content $strErrLogFile $strError
    catch
    write-host $error[0]
    Export-Csv D:\PowerShellforAD\test2.csv
    This is the error that I had get is that it will get the result for 2nd time again.
    By the way, what is InputObject about? I had research some of it and still did not quite get it. Can anyone explain? Thanks 

    Hi,
    in the final line you call Export-Csv. which is a great command at exporting information. However, for it to work it needs a path to export to (D:\PowerShellforAD\test2.csv in your case) and Information (InputObject) to export.
    You do not give that command any Information, so it throws an error.
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • How to get the result set in batches

    I have a query which results into large data. This data i want to display in a group of 20. After every 20 records i want to add header and footer to it.
    Is it possible to get the result set data into batch of 20 ? means can i specify start and end index of query ?
    regards
    Manisha

    What I am saying is that a big query with lots of
    joins will probably be slow, and as such would be a
    ripe candidate for batching the responses, if it were
    not possible to speed/optimize it. Batching is nice
    to look at for the user, but is not a solution for
    performance problems. In essence it is irrelevant
    that it adds a little performance deficit, as it
    appears to be running a lot quicker, and gives more
    feedback to the user.Then let me say it again....
    - "Join" is a term that applies to a method of doing queries in the database....
    - Query 1 which uses a join and returns 15 rows
    - Query 2 which does not use a join and returns 1500 rows.
    Given the above then Query 1 will provide better overall performance for the system than Query 2 in a properly configured database.
    If it doesn't then the database is not set up correctly.
    And again this will be irrespective of whether the query is scrollable or not.

  • How to get the result of a method on a page

    I use JDeveloper 11g
    I want the result of a method (String) in the ApplicationModule on a page (jspx)
    What I have done is:
    1. make a method (getValue) in the ApplicationModule Algemeen (also in Client interface)
    2. make a pagedef-file with executables and bindings, see
    <executables>
    <invokeAction id="doGetValue" Binds="getValue"
    Refresh="renderModel"/>
    <variableIterator id="variables" Refresh="renderModel">
    <variable Type="java.lang.String" Name="getValueReturn"
    IsQueriable="false" IsUpdateable="0"
    DefaultValue="${bindings.getValue.result}"/>
    </variableIterator>
    </executables>
    <bindings>
    <methodAction id="getValue" RequiresUpdateModel="true"
    Action="invokeMethod" MethodName="getValue"
    IsViewObjectMethod="false" DataControl="AlgemeenDataControl"
    InstanceName="AlgemeenDataControl.dataProvider"
    ReturnName="AlgemeenDataControl.methodResults.getValue_AlgemeenDataControl_dataProvider_getValue_result"/>
    <attributeValues IterBinding="variables" id="ValueReturn">
    <AttrNames>
    <Item Value="getValueReturn"/>
    </AttrNames>
    </attributeValues>
    </bindings>
    3. on the page (jspx) I have an outputText-component:
    <h:outputText value="#{bindings.ValueReturn.inputValue}"/>
    But, it does not work, I don't get the result of the method on the screen.
    Who can help me with this?

    Hi,
    Simple example below:
    Suppose you have this method in AppmoduleImpl:
    public void testHello( ) {
    return "Hello";
    1.After you expose this to clientInterface,drop this method on the jspx page as ADF Parameter
    form
    2.Drop the return String as outputText
    3.Run the page,click on the commandButton & the outputText returns 'Hello'
    Regards,
    Shantala

  • How to pass the result of one script to another?

    Hi
    Is there any possibility to pass info from one script to another? I run some scripts at night and they have to use the results I get during the day...
    Thank you in advance for any help
    Vera

    There's a couple of ways of doing this.
    It sounds like the second script isn't being called directly from the first one, so you can't pass the data directly, so that leaves you with a couple of options.
    One is to have the first script write the data to a file, then have the second script read that file.
    The other would be to store the data as a property in the first script - properties are saved between executions - then have the second script read the first script's property when it starts up.
    For the first option, just have the script write the data to a file:
    set myData to "here's the data to save"
    set myFile to (open for access file (path to home folder as text & "data.file") with write permission
    write myData to myFile starting at 0
    close access myFile
    Now the second script can read the file:
    set otherScriptsData to read file (path to home folder as text & "data.file")
    For the second option, just store the data as a property:
    property myData:""
    set myData to "here's the data to save"
    Now loading the data in the second script goes like:
    set otherScript to load script file "path:to:other.scpt"
    set otherScriptsData to otherScript's myData
    Here you can see the second script loading the script then reading its myData property.

  • How to get the result from graph  based on table prompt?

    I have one report in which I am having one table and three Graphs. I have added table prompt for one column i.e department. In that I have given three values. The values of my table changes as per the table prompt. But my requirement is my graphs should show me the result as per the selection of departments in table prompt. Please give me the solution for the same.

    Hi,
    Create a event channel the table view and refer the same channel name in the graph properties.
    Edit Graph --> Edit properties --> Enable Master-Details Events --> Give the channel name.
    It will work for the selection of table .
    Mark if helps.
    Raja Mohamed

  • Copying data out of WFA: how to get the results of a job

    I'm currently using WFA 2.2.0.2.6 in a product environment to create storage volumes and whilst the scripting aspects of it make provisioning the storage. there is one aspect that is difficult: getting the name of the volume path. Why is that difficult? When I execute the a workflow with WFA, the various steps in the "Execution Plan" all light up green and the volumes/qtrees created are put into the "Return parameters" tab. When I go to that "Return parameters" tab, I cannot select the data presented there for copying out. I am forced to manually transcribe what's presented in the "Returns parameters" tab. Is there a workaround for this?Some other way to get the volume path, share names, etc, that a workflow creates so that it can be easily copy and pasted for use elsewhere? Kind Regards,Darren 

    Hi, Yes we can't copy the return parameters  from the "Return parameters" tab.  If return parameter is used as input parameter for command in the workflow, those return parameter values can be copied from "execution plan" tab. Regards,Veerendranadh CH  

Maybe you are looking for

  • I have a hard drive with my data from my previous PC, it won't recognise on my macbook!!

    Please please please help me I have all my data from my previous PC laptop from when it died and its on an external hard drive. I looked at the online tutorial and the macbook is not recognising the hard drive. I have been on hold to mac online suppo

  • Computer Crashed with CS4 - How can I get these programs to my new computer?

    Computer Crashed with CS4 - How can I get these programs to my new computer?

  • MSI 648 S-Bracket

    I am intrested in purchasing the optional S-Bracket in order to connect a 5.1 speaker setup to my MSI 648Max board. However I am unable to find an online retailer that actually sells this S-Bracket. Where can I find one in the UK?

  • Elements 5.0 Won't Open DNG Files

    I used Adobe DNG Converter version 8.3.0.141 to convert .rw2 files created by my Panasonic Lumix FZ200 camera.  These files won't transfer into the Organizer and, when trying to open them from the Editor, I get an error message saying the file can't

  • Finder DOES NOT Respond after Restart, Or Shut Down

    I am running an iMac G5 on OS X 10.5.4, After a shut down or restart, Finder does not respond, The only thing on my desktop is My HD and Chosen wallpaper. I can launch Apps from the Dock, but not folders from the dock, Not Downloads folder, Documents