Git Product home page Git Product logo

altiris4ever / hash_copy_all_files_and_folders Goto Github PK

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

This Powershell script uses file hashes to compare and only copy all the missing or changed file(s) & folder(s) into the target directory from the defined source directory. This script is ignoring any file(s) and folder(s) if they only exist in the destination directory. This script write everything to a log file.

PowerShell 100.00%

hash_copy_all_files_and_folders's Introduction

Hash_copy_all_files_and_folders

.SYNOPSIS This Powershell script uses file hashes to compare and only copy all the missing or changed file(s) & folder(s) into the target directory from the defined source directory.

.DESCRIPTION This Powershell script uses file hashes to compare and only copy all the missing or changed file(s) & folder(s) into the target directory from the defined source directory. This script is ignoring any file(s) and folder(s) if they only exist in the destination directory. This script write everyhing to a log file.

This script accepts 4 parameters. -source The name of source directory. c:\temp\test -destination The name of destination directory. c:\temp\test2 -writeoutput $true og $false : output activity to console $true -logfile The name and destination of the logfile, like c:\temp\logfile.log

.EXAMPLE .\scriptname.ps1 -source -destination -logfile -writeoutput $true scriptname.ps1 -source c:\temp\1 -destination c:\temp\2 -logfile c:\temp\logefile.log -writeoutput $true #Examplescript 1: For uploading Teams backgroundfiles into each users "env:USERPROFILE"\AppData\Roaming\Microsoft\Teams\Backgrounds\Uploads" folder from a fileshare. #if this script is signed it could be run alongside envionments who has Applocker activated, even by the std user account on logon, or by SCCM,a scheduled task or something similar like that. scriptname.ps1 -source \fileshare\teams\ -destination $env:USERPROFILE"\AppData\Roaming\Microsoft\Teams\Backgrounds\Uploads" -logfile $env:USERPROFILE"\AppData\Roaming\Microsoft\Teams\Backgrounds\Background_copy.log" #Examplescript 2: For downloading notepad ++ plugins from a fileshare into %programfiles%\notepad++\plugins folder. MUST RUN THIS WITH admin right since it's a protected system folder. scriptname.ps1 -source \fileshare\notepad++\plugin\ -destination "C:\Program Files\Notepad++\plugins" -logfile "C:\Program Files\Notepad++\plugins\Plugin_copy.log"

.NOTES Author: https://twitter.com/ArneJ666

.TODO Make som more advanced inputcheck on -source -destination and -logfile. Only standard errorchecking. Better formating of time used in logfile.

hash_copy_all_files_and_folders's People

Contributors

altiris4ever avatar

Watchers

 avatar

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.