Deleting Files based on Retention Period

Welcome Forums General PowerShell Q&A Deleting Files based on Retention Period

This topic contains 2 replies, has 3 voices, and was last updated by

1 year, 1 month ago.

  • Author
  • #91771

    Points: 0
    Rank: Member


    I would like some assistance to start buidling a script to delete files from specific folders based on the retention periods mentioned in the configuration file


    The script should be able to read the data from the Config file and delete all files in the folder that are equal to or greater than the time period mentioned in the tag.


  • #91778

    Points: 176
    Helping Hand
    Rank: Participant

    Please share the code you've written so far.

  • #91843

    Points: 790
    Helping Hand
    Rank: Major Contributor

    All you need to get you going down the right direction is in the PowerShell built-in Help files...

    Get parameter, examples, full and Online help for a cmdlet or function

        (Get-Command -Name Get-Content).Parameters
        Get-help -Name Get-Content -Examples
        Get-help -Name Get-Content -Full
        Get-help -Name Get-Content -Online
        (Get-Command -Name Import-Clixml).Parameters
        Get-help -Name Import-Clixml -Examples
        Get-help -Name Import-Clixml -Full
        Get-help -Name Import-Clixml -Online
        (Get-Command -Name Select-String).Parameters
        Get-help -Name Select-String -Examples
        Get-help -Name Select-String -Full
        Get-help -Name Select-String -Online
        (Get-Command -Name Get-Date).Parameters
        Get-help -Name Get-Date -Examples
        Get-help -Name Get-Date -Full
        Get-help -Name Get-Date -Online
        (Get-Command -Name Remove-Item).Parameters
        Get-help -Name Remove-Item -Examples
        Get-help -Name Remove-Item -Full
        Get-help -Name Remove-Item -Online

    ... and of course TechNet and MS docs sites.

    PowerShell Documentaiton

    PowerShell Loops

The topic ‘Deleting Files based on Retention Period’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort