Created
August 3, 2017 10:10
-
-
Save spy86/f5e20260d2b085886a6ed3ed710dbd75 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#we specify the directory where all files that we want to upload | |
$Dir="C:/Dir" | |
#ftp server | |
$ftp = "ftp://xxx.xxx.xxx/dir/" | |
$user = "user" | |
$pass = "Pass" | |
$webclient = New-Object System.Net.WebClient | |
$webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass) | |
#list every sql server trace file | |
foreach($item in (dir $Dir "*.trc")){ | |
"Uploading $item..." | |
$uri = New-Object System.Uri($ftp+$item.Name) | |
$webclient.UploadFile($uri, $item.FullName) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment