Share via

PowerShell Script to Delete Files Based on Current Date

Anonymous
2014-12-04T19:15:04+00:00

I know by using Get-Date PowerShell will look at the current date.  I would like to make a very basic PS Script which will delete a file older than 8 days based on the current day.  I believe using a if/then function will be necessary.  I am very new to scripting so Im not sure how the syntax is written.  All help appreciated.

Windows for home | Other | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2014-12-04T20:07:04+00:00

    ITb

    It is a different platform.  You have to repost it.  While I moderate in both  it cannot be moved there because there are different credentials

    If you cannot find a relevant section you can put it in the "where is the forum for..." section and one of the moderators will move it accordingly.

    If you put a link to it here I will subscribe to it there.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-12-04T19:45:44+00:00

    I looked for an option to move this string over.  Could you do it or do I have to write a new one for the TechNet forum?

    Was this answer helpful?

    0 comments No comments