Get-date problem

Welcome Forums General PowerShell Q&A Get-date problem

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years ago.

  • Author
    Posts
  • #6242

    Member
    Points: 0
    Rank: Member

    by taheito at 2012-12-22 06:20:43

    Hello,
    my project start was "01 Sept 2012" and i am generating bi-weekly reports to see the project progress. so i need to pipe the Get-date to be (Today – "01 Sept 2012) how I can do that ?
    the script is below
    get-qaduser -SizeLimit 0 -NotLoggedOnFor (Today – '01 Sept 2012)

    by Klaas at 2012-12-23 02:00:12

    you could try this:
    $DaysSinceSep01 = ($(get-date) - $(get-date('01/09/2012'))).days
    get-qaduser -SizeLimit 0 -NotLoggedOnFor ($DaysSinceSep01)

    Depending on your locale settings you might have to switch '01' and '09'.

The topic ‘Get-date problem’ is closed to new replies.