locked
get-date add minutes and format RRS feed

  • Question

  • Hi, i am trying to get a remote get-date, add 5 minutes and display as HH:mm

    I do like:

    $remotetime= invoke-command -computer $computer{(Get-Date)Addminutes(5)}
    
    

    This gets me the remote time plus 5 minutes

    If then i try to format with:

    $remotetime -f HH:mm

    You must provide a value expression on the right-hand side of the '-f' operator.

    Any idea?

    Wednesday, April 10, 2013 8:23 AM

Answers

  • (get-date).AddMinutes(5).ToString("HH:mm")
    • Marked as answer by slowscripter Wednesday, April 10, 2013 9:47 AM
    Wednesday, April 10, 2013 8:28 AM

All replies