daily pastebin goal
65%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $StartCopyButton.Add_Click({
  2.     $script:CancelLoop = $false
  3.     $CancelButton.Enabled = $true
  4.     $StartCopyButton.Enabled = $false
  5.  
  6.     Get-ChildItem -LiteralPath $Source -Recurse -File | ForEach {
  7.         Copy-Item -Path $.FullName -Destination $NewDestination
  8.         [System.Windows.Forms.Application]::DoEvents()
  9.         If($script:CancelLoop -eq $true) {
  10.             #Exit the loop
  11.             Break;
  12.         }
  13.     }
  14.     $CancelButton.Enabled = $false
  15.     $StartCopyButton.Enabled = $true
  16. })
  17.  
  18. $CancelButton.Add_Click({
  19.     $script:CancelLoop = $true
  20. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top