Git Product home page Git Product logo

powershell.moving-time's Introduction

Moving Time

A Powershell script that allows a user to backup and restore a list of files or file paths via a GUI.

demo


Demo the script

  • Clone or download this repo
  • Go into the example folder and double-click the genFiles.bat file. It'll then set up some folders and files of varying sizes.
  • Then go back up to the root of this repo and right-click moving-time.ps1 and select Run with Powershell.
  • Once the GUI opens, click the Start Backup button.
    • Once the script has completed you'll see the example/output folder now has a backup folder in it, with the folders and files specified in example/conf.psd1.
  • After the backup has completed, rename example/source to example/source.bak.
  • Click the Restore radio at the top of the GUI and then click the Start Restore button.
    • Once the script has completed you'll see the example/source folder has been created, containing the files and folders from example/output.

Create your own config

  • Copy the file example/conf.psd1 to the root of the repo
  • At the top of moving-time.ps1
    • Find the # Import config line, and edit the below lines to look like:
    $conf = Import-PowerShellDataFile ".\conf.psd1"
    # $conf = Import-PowerShellDataFile ".\example\conf.psd1"

Here are the available top-level options for a config:

Prop Type Value
bagPath String Absolute or relative path to where files will be backed up to or restored from.
itemsList Array of HashTable

The available properties for itemsList are listed below. Optional properties are surrounded in [<NAME>].

Prop Type Value
label String The name that will be printed above each item being synced.
paths Array of String Absolute or relative path to a folder or file.
[excludedFiles] String A space delimited list of file names or paths that won't be synced.
[excludedFolders] String A space delimited list of folders that won't be synced.
[filters] String Files or file types that will be synced. It uses Robocopy's File syntax for patterns.
[recursive] Boolean All syncs are recursive by default, but if you want to only copy top-level files, you would set this to $false.

Creating a shortcut to the script

  • Right-click moving-time.ps1 and select Create Shortcut
  • Right-click the new shortcut and select Properties
  • Change Target to %WINDIR%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File ".\moving-time.ps1". If you want to have the shortcut in another location other than this folder, change .\moving-time.ps1 to be the absolute path of the file.
  • Click the Change Icon button, navigate to this folder and select assets/app.ico.

Now you can just double click the shortcut and it'll run via Powershell.


Notes

powershell.moving-time's People

Contributors

the0newhoknocks avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

resonancellc

powershell.moving-time's Issues

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.