Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Source=Read-Host "C:\Dane"
- $Destination=Read-Host "C:\Shares\Backup"
- $Folder=Read-Host "File Server"
- $validation=Test-Path $Destination
- New-PSDrive -Name "Backup" -PSProvider FileSystem -Root $Destination
- if ($validation -eq $True){
- Set-Location Backup:
- }
- else{
- Write-Host "Error!Run Script Again"
- break
- }
- robocopy $Source $Destination\$Folder *.* /mir /sec
- Function Pause{
- Write-Host "Backup Sucessfull!!! `n"
- Write-Host "Press any key to continue..."
- $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
- }
- Pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement