Giter Site home page Giter Site logo

sorzkode / thisoldfile Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 95 KB

PowerShell script that lists details about the oldest file in a given directory.

Home Page: https://github.com/sorzkode/ThisOldFile

License: MIT License

PowerShell 100.00%
creation-date modification-time powershell powershell-script sorzkode oldest-file

thisoldfile's Introduction

This Old File

Overview

Welcome to the This Old File script! This PowerShell script is designed to help you identify and display the oldest file in a specified directory. Use this tool to quickly find information about the file that has been present in the directory the longest.

Instructions

Follow the steps below to run the script:

  1. Download the Script:

    • Download the script file (ThisOldFile.ps1) to your local machine.
  2. Run the Script:

    • Open PowerShell on your machine.
    • Navigate to the directory where you saved the script using the cd command.
    • Execute the script by entering .\ThisOldFile.ps1 and pressing Enter.
  3. Input Directory Path:

    • The script will prompt you to enter the directory path where you want to find the oldest file.
  4. Review Results:

    • The script will display details of the oldest file in the specified directory, including its name, size, creation time, and last modified time.
  5. Repeat or Exit:

    • After reviewing the results, you can choose to search for the oldest file in another directory by entering 'Y' when prompted.
    • To exit the script, enter 'N' when prompted.

Important Notes

  • Ensure that you have the necessary permissions to access the directories you intend to search.
  • The script considers the oldest file based on the creation time.

Example Usage

Welcome to the This Old File script!
This script will list the oldest file in a directory.
Please follow the instructions below:

Enter the directory path: C:\Users\Username\Documents
Oldest file in C:\Users\Username\Documents:
Name: OldestFile.txt
Size: 1024 bytes
Creation Time: 2022-01-01 08:00:00
Last Modified Time: 2022-01-02 10:30:15

Do you want to search for files in a different directory? (Y/N): Y
Enter the directory path: D:\Projects
No files found in D:\Projects.

Do you want to search for files in a different directory? (Y/N): N

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.