How do I add a timestamp to a line generated by a cmdlet?

Hi,
I get the output "No Backlog for the replicated folder named "S1"" in the outfile.txt when I run the Get-DfsrBacklog command below.  What I would like is to prefix or suffix this line with the Date and Time, keeping it all on the
same line as follows"
"08/13/14 04:30:00 pm No Backlog for the replicated folder named "S1""VOL Share"
Get-DfsrBacklog -GroupName "G1" -FolderName "S1" -SourceComputerName "DC1" -DestinationComputerName  "DC2" -Verbose  4>> outfile.txt
Any suggestions on how I can do this?
Thanks for your help! SdeDot

When using the + operator, it depends on the first operand.
PS C:\> "Log message " + (Get-Date)
Log message 08/13/2014 14:03:02
PS C:\> (Get-Date) + "Log Message"
Cannot convert argument "1", with value: "Log Message", for "op_Addition" to type "System.TimeSpan": "Cannot convert va
lue "Log Message" to type "System.TimeSpan". Error: "Input string was not in a correct format.""
At line:1 char:13
+ (Get-Date) + <<<< "Log Message"
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument
PS C:\> ((Get-Date).ToString()) + " Log Message"
13/08/2014 2:03:26 PM Log Message
PS C:\>

Similar Messages

  • [Solved] How to: Automatically add Semicolons at end of line

    Q. Is it possible to set JDeveloper to automatically add Semicolons to the end of a line of code?
    A. "While there is nothing that does this in batch mode to all your lines, while you are writing a line you can press the CTRL+SHIFT+Enter (complete statement in the source menu) shortcut and it will complete your line for you including the semicolon." [Solved] How to: Automatically add Semicolons at end of line
    Original Message:
    I'm spoiled from using Basic and similar programming languages, adding semicolons manually is something that'll take me time to get used to
    Thanks in advance,
    Abdulla
    Tags (for search engines):
    Jdeveloper automatic semicolon
    Message was edited by:
    Abdulla

    While there is nothing that does this in batch mode to all your lines, while you are writing a line you can press the CTRL+SHIFT+Enter (complete statement in the source menu) shortcut and it will complete your line for you including the semicolon.

  • How can I add the expiration date at line item level

    My User is selling voucher. The voucher is sell at line item. eg GV$5, GV$10,etc
    Each voucher line item sold need to be entered with a EXPIRATION date of that voucher.
    Maybe 3 months from issue, maybe 6months/1 year from issue.
    How can I add this to the sales order line item level?
    Which field can I used and how to configure?

    Hi Colin ,
       The question is not very clear , but i assume that you are asking about the  self expiry date of the particular material ,
    1. The setting you can do by activating  shelf life data  in material master :Plant data/stor1
    2.  its better to have a batch managed material for that you can sort the material acording the self expiry date.
    3. Once you maintain self expiry date system by default pick  the material at the time of  delivery
    Note-Shelf life expiry it will give the life of the material from the day of manfacture,remaining shelf life also will  give .
    Hope it is helpful
    Best regards
    Venkat

  • How do I add and or remove grid lines in numbers

    How do I add or remove grid lines in numbers.

    See this thread:
    https://discussions.apple.com/thread/6546166?q=Numbers%20gridlines
    Post back if you still have questions.

  • How do i add a timestamp in ipad numbers

    I cant find any where better to post this so I hope it is ok here if not please feel free to remove to a better section
    As the title states really I need to enter a number in D2 and then D3 needs to show the time of the entry in D2.
    I assume it goes down the lines of if D2 > 0 and D3 = "" then D3 = Time. But I have never used spread sheets at all, this is my first encounter and the Ipad numbers syntax is pretty confusing for a nuube.
    Any advice would be great

    @ SG111 Thanks for the reply but I dont think you understand the question my friend, your answer is not relevant to what i was asking at all
    @ T quinn
    1 it seems ludicrous that it is impossible to simply add a time stamp it seems a very important yet simple task to use a timestamp in a spread sheet so why not have it in numbers?
    It seems it is impossible from what i gather yet it seems so easy to do with the logic after all many applications use a very simple time for input criteria.
    I see no issue with the logic that if D3 ="" and D2>0 then Time stamp D3. Once D3="NOW" it no longer ="" and should not alter the time when the calcs are made.....
    My main issue is actually getting the syntax right in the numbers logic functions
    Maybe Numbers simply does not allow it in which case it is a pretty useless piece of software indeed!
    Any way thanks for the help

  • How do i add recordsets to a .dwt.asp-generated page

    help - i am at wits end.....
    below is code for a page (test3.asp) based on a template
    called "catalogue.dwt.asp". i need various recordsets on various
    pages based on this template. f i try to add a recordset to
    test3.asp, i'm told "making this change would involve changing cose
    that is locked by a template or translator" - so i cant add the
    recordsets (tho interestingly you can see that i did manage to
    somehow add two recordsets at the outset before it started saying
    this.
    if i try to add the recordsets to the template (which is not
    the way i want to do it anyway), i'm told i've added code outside
    the html tag and wont be copied unless i add
    <!--TemplateInfoOutsideHTMLIsLocked-->
    i have bvuilt plenty of other sites where i DONT have this
    issue so DW/me must be coding something different sometimes -
    bottom line is - how do i get to having a .dwt.asp temaplte which i
    can build other pages from, and then add relevant recordsets to.
    i would be DEARLY GRATEFUL for anyone who can help me put
    this perennial problem to bed.
    thanks in advance:
    Code attached

    Funny, I have never seen anyone report this. And I've worked
    with DW and
    recordsets in template child pages for a mightly long time,
    and never
    experienced it. On the other hand, it's always a good idea to
    restart your
    system when things like this happen. You never know what
    could be
    interfering.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Ed Stewart" <[email protected]> wrote in message
    news:fe80k0$4tb$[email protected]..
    >> below is code for a page (test3.asp) based on a
    template called
    >> "catalogue.dwt.asp". i need various recordsets on
    various pages based on
    >> this
    >> template. f i try to add a recordset to test3.asp,
    i'm told "making this
    >> change
    >> would involve changing cose that is locked by a
    template or translator" -
    >> so i
    >> cant add the recordsets (tho interestingly you can
    see that i did manage
    >> to
    >> somehow add two recordsets at the outset before it
    started saying this.
    >>
    >> if i try to add the recordsets to the template
    (which is not the way i
    >> want to
    >> do it anyway), i'm told i've added code outside the
    html tag and wont be
    >> copied
    >> unless i add
    <!--TemplateInfoOutsideHTMLIsLocked-->
    >>
    >> i have bvuilt plenty of other sites where i DONT
    have this issue so DW/me
    >> must
    >> be coding something different sometimes - bottom
    line is - how do i get
    >> to
    >> having a .dwt.asp temaplte which i can build other
    pages from, and then
    >> add
    >> relevant recordsets to.
    >>
    >> i would be DEARLY GRATEFUL for anyone who can help
    me put this perennial
    >> problem to bed.
    >
    >
    >
    >
    > It's a bug. Close and re-open DW and your templated page
    will accept the
    > RS without squawking.

  • I have NDS 4.16, and I have iMS 5.1 running on Sun, Solaris 8. I want to know how can I add users using the command line instead of the console. My problem is how to set the password to this user?

     

    You can use ldapmodify found in <ServerRoot>/shared/bin
    for example
    ./ldapmodify -h ldaphost -D "cn=directory manager" -w password -f <name of LDIF file>
    Here's an example LDIF file
    dn: uid=cms,ou=people,o=balius.com,o=Universe
    changetype: add
    objectClass: person
    objectClass: organizationalPerson
    objectClass: inetOrgPerson
    objectClass: inetUser
    objectClass: ipUser
    objectClass: inetMailUser
    objectClass: inetLocalMailRecipient
    objectClass: nsManagedPerson
    objectClass: userPresenceProfile
    cn: Chad M. Stewart
    sn: Stewart
    initials: CMS
    givenName: Chad
    pabURI: ldap://host:389/ou=cms,ou=people,o=balius.com,o=Universe,o=pab
    mail: [email protected]
    mailDeliveryOption: mailbox
    mailHost: my.mailhost.com
    uid: cms
    dataSource: Chad by hand
    userPassword: users-password-here
    inetUserStatus: active
    mailUserStatus: active
    mailQuota: -1
    on a subsequent search you'd see something like
    userpassword: {SHA}S3e+L/K6

  • JTextArea How do I add text on a new line from Text field

    I want to put each new input from the text field at the start of a new line and keep the previous entries at the start of their
    own line.
    I'm doing this but need help with the new line.
    jTextArea1.setLineWrap(true);
    jTextArea1.setWrapStyleWord(true);
    jTextArea1.setEditable(false);
    public void textProcess()
    System.out.println(sourceref1.getSourceText());
    jTextArea1.setText(jTextArea1.getText()+" "+source.getSourceText());
    The above just keeps adding on the new text until I reach the word wrap limit.
    Thanks

    Maybe you should use the escape character. Anyway, you can consider use append(text:String) instead of getText() everytime.
    Eg:
    jTextArea1.append("\n"+source.getSourceText());

  • How do I add power to a non-line level microphone?

    I made the mistake of buying a unpowered mic thinking the MBP had a mic-in, which it doesn't. I'm wondering what it will take to get it to work -- like a usb audio hub or something, etc. Are there any inexpensive solutions?

    A small pre-amp will do the trick for you, these work great.
    http://www.behringer.com/PP400/index.cfm?lang=ENG

  • How do i add a newline or carriage return to make my xml file look pretty?

    Hi guys
    I'm writing an xml file with jsp, the problem is, it writes it in one big chunk of text. e.g.
    <start>hello, my name is joe</start><middle>I like trees</middle><end>boo</end>
    Now what I want to do is present this xml file in a decent manner,
    e.g.
    <start>hello my name is joe</start>
    <middle>i like trees</middle>
    <end>boo</end>
    i've tried
    xmlFile = "<start>Hello my name is joe</start>"+\n\r;
    and
    xmlFile ="<start>Hello my name is joe</start>"+"\n\r";
    neither work, can anyone provide me with some insight into how I can add a carriage return / new line to make my xml file look pretty?
    Many thanks for any responses!

    u r right <BR> tag will not work...
    I wrote following code to generate xml file and it works fine...U can try the same...
    try
    FileOutputStream fos = new FileOutputStream("c:\\temp.xml");
    String xmlString = "<root>\n<start>Hello my name is joe</start>"+"\n";
    xmlString = xmlString +"<middle>blah blah</middle>\n</root>";
    fos.write(xmlString.getBytes());
    fos.close();
    fos = null;
    catch(Exception e)
    e.printStackTrace();
    }

  • How do I add timestamps to spreadshee​t data?

    Hi All,
    Yet another gumby question from yours truly...
    What is the easiest way to add timestamps to the data collected here?
    I would like to add a timestamp to each row that contains data from Dev2/ai0 and ai1.
    Many thanks in advance!
    Solved!
    Go to Solution.

    Timestamp to Excel is attached
    Jeff
    Attachments:
    Time to XL.vi ‏19 KB

  • How do I add a time stamp to the moving "Major Grid Lines" of a Waveform Chart?

    Hello
    I am using LV 8.5.1
    I am using a Waveform Chart and I have turned on the "Major Grid LInes" using the properties tab of my waveform chart. (properties-->scale->grid lines)
    When the code executes, I want to attach  a time stamp to each moving yellow grid line.
    So as the grid lines move from right to left, there is an associated time stamp for each.
    Can someone help!
    thanks
    J
    Solved!
    Go to Solution.
    Attachments:
    how do I add time to the yellow grid lines.vi ‏16 KB

    hova2010,
    If you right click on your graph and go to X Scale >> Style >> and then choose one of the 3 styles on the far left you shoul see timestamps for those grid lines.
    Ben Sisney
    FlexRIO V&V Engineer
    National Instruments

  • How do i add time and date to target file

    hello,
    1. When do we generally go for FCC?
    2. Is it possible to assign field seperator without FCC on the reciever side file adapter?
    3. how do I add timestamp as well as DATE to the target file?
    thnks
    venkat

    Hi venkat
    1. When do we generally go for FCC?
        we can do the FCC at sender side as well as at the receiver side.
        Sender side: we do the FCC at the sender side only if we are getting a flat file   from the sender, and so that it can be understand by the XI,because XI can understand only the XML.
         Receiver side:we do the FCC at the receiver side only if the receiver requires the flat file.
    2. Is it possible to assign field seperator without FCC on the reciever side file adapter?
    no, it is not possible.
    3. how do I add timestamp as well as DATE to the target file?
    if you want to add date and time in the target file for this you have to select the parameter
      File Construction Mode* : AddTimeStamp
    in the processing parameters of the file adapter(Receiver).
    Thanks
    Rinku

  • How to find/add matched logfile into PL/SQL

    Hi,
    I make a PL/SQl like below to automate logminer to find out DMLs done in a schema (SCOTT) after a specific time.
    declare
    v_user_name varchar2(50) := 'SCOTT';
    V_ARCHIVE_LOG_DEST VARCHAR2(50) := '/var/tmp/arch';
    V_sequence_max number;
    v_start_query_time TIMESTAMP := '08-JAN-2010 00:00:00';
    begin
    --Create DICTIONARY file on the SOURCE database's redo files
    sys.dbms_logmnr_d.build( OPTIONS => sys.DBMS_LOGMNR_D.store_in_redo_logs);
    select MAX(sequence#) into V_sequence_max from v$archived_log WHERE DICTIONARY_BEGIN = 'YES' AND dictionary_end = 'YES';
    --add dictionary log files
    dbms_logmnr.add_logfile( logfilename=> 'V_ARCHIVE_LOG_DEST/1_3715_573231463.dbf',
    options=> dbms_logmnr.new);
    --add log files
    exec dbms_logmnr.add_logfile( logfilename=> 'V_ARCHIVE_LOG_DEST/1_3716_573231463.dbf');
    exec dbms_logmnr.add_logfile( logfilename=> 'V_ARCHIVE_LOG_DEST/1_3717_573231463.dbf');
    --start LogMiner, also (by the way) enable ddl tracking
    exec dbms_logmnr.start_logmnr(options => dbms_logmnr.dict_from_redo_logs + dbms_logmnr.ddl_dict_tracking);
    --To query
    execute immediate 'alter session set nls_date_format = ''dd_MM_yyyy hh24:mi:ss''';
    execute immediate 'SELECT username, sQL_REDO, SQL_UNDO FROM V$LOGMNR_CONTENTS WHERE username = ''v_user_name'' AND TIMESTAMP > ''v_start_query_time''';
    --END LOGMINER
    DBMS_LOGMNR.END_LOGMNR();
    END;
    ##########################3
    My question,
    After find out the redo logs SCN which include snapshot of data dictionary like below,
    select MAX(sequence#) into V_sequence_max from v$archived_log WHERE DICTIONARY_BEGIN = 'YES' AND dictionary_end = 'YES';
    I try to
    --add dictionary log files
    dbms_logmnr.add_logfile( logfilename=> *'V_ARCHIVE_LOG_DEST/1_3715_573231463.dbf'*,
    options=> dbms_logmnr.new); ---how can I add the logfile with above SCN# here automatically, above is just manually added.
    --add log files,
    exec dbms_logmnr.add_logfile( logfilename=> 'V_ARCHIVE_LOG_DEST/1_3716_573231463.dbf');
    exec dbms_logmnr.add_logfile( logfilename=> 'V_ARCHIVE_LOG_DEST/1_3717_573231463.dbf');
    ---how can I add all the files with SCN numbers after (>MAX(sequence#) ) here automatically?? --above redo files are just manually  added
    thanks
    Edited by: ROY123 on Jan 11, 2010 12:40 PM

    Is there any reason to not use [Fine Grained Auditing|http://www.oracle.com/technology/deploy/security/database-security/fine-grained-auditing/index.html] for something like this?
    Why reinvent the wheel in a more complex fashion ?

  • Add date-timestamp to PDF

    Hi,
    Is there a way I could add current date-timestamp to the PDF, when the PDF is opened or printed?
    I read the iTEXT documentation and it seems its possible to add javascript to the PDF document using iTEXT and this javascript will get executed when the PDF is opened.
    I was successful in adding the "this.print" javascript; however, I am still struggling to figure out how to add "this.addWaterMarkFromText" javascript. I know I can use the iText API to add watermarks, however, I want to use the Adobe Javascript instead. This exercise is just to figure out how to add javascript to PDF.
    This would help me figure out how to use various Adobe javascript events such as "WillPrint" to dynamically add the timestamp just before the Print button is clicked.
    Any help will be highly appreciated.
    Thanks,
    Shilpa.

    Hi Shilpa,
    Please note, I am using C# in my example code, but the solution is similar in Java.
    To answer your question regarding using javascript events like Will Print, one way to add a timestamp by first creating a (blank, readonly) field and adding it to your document using iText using, say iTextSharp.text.pdf.TextField. Then you assign javascript to the WillPrint event with writer.SetAdditionalAction(PdfName.WP, PdfAction.JavaScript(jScriptBeforePrint, writer))where writer is an instance of iTextSharp.text.pdf.PdfWriter.
    The javascript, in this case jScriptBeforePrint, will change the value of the field you created earlier to contain the date-timestamp value. For example, you can use:
    this.getField('datestmp').value =\"This document was printed at \" + util.printd(\"HH:MM on mmmm dd, yyyy\",new Date());where datestmp is the name of the field created earlier.
    (by the way Will Print is initiated after the clicking of the print button, not before - as per your post).
    Callan

Maybe you are looking for

  • Printing Page Numbers - From To

    Please can you help me. I am exporting a Crystal Report to PDF per customer through vb code. I need to print a maximum number of pages (that will fit in an envelope e.g. 20) and then continue printing his data into a second PDF where it left off. The

  • Bdc for multiple line items

    hi all, i am developing bdc program to upload multiple line items for ml10. i am uploading folling fields spec_no astyp txz01, sort1, waers, matkl, ekorg, srvpos ' service number menge. 'quantity service number and quantity are multiple line items. i

  • Where to find and which subwoofer ?

    Hello, I bought a i-trigue-2200 set 4 months ago. I notice on the back of the main speaker a port to plug a subwoofer. 1) which model ? (I have heard about P50 ) 2) where can I found such a device ? (I live near to Paris, France). Thank you for your

  • Why do i need to restore my ipod 4g after attempting to download ios6?

    I tried to update my ipod4g to ios 6. After some time, a screen came up telling me to connect to itunes. Turns out that i am stuck in recovery mode. Why did this happen and is there any way for me to use my ipod again without restoring?

  • Query Using Send a alert at once not continuously

    Hi, How to control the Alert using Query ?. if i add a Purchase order alert is sent to assigned user i write a query and set the query in alert mananagement window. remainder is set for one minute alert is working fine but is repeating every minutes