Powershell Script

Gabi1986 1 Reputation point
2020-08-03T15:49:06.427+00:00

15137-myscript.jpg

Hello Everyone,

I'm a beginner Powershell user. Could anyone help me to finish this script? I'd like to copy new files from "$a" to "$b"... automatically of course. How should I move on?
Thanks a lot.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,501 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Andreas Baumgarten 107K Reputation points MVP
    2020-08-03T18:29:49.417+00:00

    Maybe this is helpful. (For any reason I can't post this as code ... getting an "Access denied" everytime)

    15158-code.png

    Regards

    Andreas Baumgarten

    (Please don't forget to Accept as answer if the reply is helpful)

    1 person found this answer helpful.

  2. 2020-08-20T01:45:38.553+00:00

    Hi, given that this post has been quiet for a while, this is a quick question and answer. Has your question been solved? If so, please mark it as an answer so that users with the same question can find and get help

    0 comments No comments

  3. gastone canali 236 Reputation points
    2020-08-27T00:19:32.103+00:00

    With Powershell you can do everything, but robocopy.exe is insuperable for copying, synking also deleting!
    This is the code, remove /L when you are sure...
    /L : List only - don’t copy, timestamp or delete any files.

    $Afolder = 'c:\user\Gab\desktop\A'  
    $Bfolder =  'c:\user\Gab\desktop\B'  
      
      
      
    Invoke-Command { robocopy.exe $afolder $Bfolder /L /s /w:0 /r:0 }  
    

    robocopy

    robocopy.html

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.