daily pastebin goal
16%
SHARE
TWEET

Untitled

a guest Sep 23rd, 2016 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $Dir="/home/bar-foo/bar/foo/upload.png"
  2.  
  3. #ftp server
  4. $ftp = "ftp://ftp.foo-bar.se"
  5. $user = "FooBar@barfoo.bar-foo.bar"
  6. $pass = "MyUn1t3dSt4t3s0fwhut3v4h"
  7.  
  8. $webclient = New-Object System.Net.WebClient
  9.  
  10. $webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass)
  11.  
  12. #list every sql server trace file
  13. foreach($item in (dir $Dir "*.trc")){
  14.     "Uploading $item..."
  15.     $uri = New-Object System.Uri($ftp+$item.Name)
  16.     $webclient.UploadFile($uri, $item.FullName)
  17.  }
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