Skip to content

PowerShell example

Robocopy command with an IF statement to report Status Code;

# START OF CODE #
robocopy “C:\temp\Scripts\Robocopy” “C:\temp\Scripts\Robocopy\COPIED” *.* /xo

if ( $LASTEXITCODE -eq 1) {
Write-Host “Success!”
}
else {
Write-Host “Something happened !”
}

# END OF CODE #

We can copy all in bold at the end of each of our functions and this will provide the user/s with feedback.

Veeam BR

https://github.com/VeeamHub/powershell/tree/master/BR-MorningReport

There is one script that collates all the scripting functionalities for each phase. This MUST be ran under Administrator privileges in all instances. When ran, it provides a Menu for the user;

  1. Press 1. for copying from Internet machine to USB drive.
  2. Press 2. for copying from USB Drive onto the Trellix Environmental Server
  3. Press 3. to exit.