-
-
Save hackerman518/f8c1b2789cd2bf081f13404e5fdeddda to your computer and use it in GitHub Desktop.
Revisions
-
harnerdesigns revised this gist
Sep 27, 2017 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -26,6 +26,12 @@ foreach($item in (dir $Dir "*.*")){ #Move file to today's folder Move-Item $item.FullName -destination $path } #Beep When Finished function b($a,$b){ [console]::beep($a,$b) } b 1000 100; b 1333 200; -
harnerdesigns created this gist
Jun 13, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ #Directory To Pull Files From $Dir="C:\foo\bar\toBeUploaded" #FTP site and credentials $ftp = "ftp://ftp.somesite.com/" $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 "*.*")){ "Uploading $item..." $uri = New-Object System.Uri($ftp+$item.Name) $webclient.UploadFile($uri, $item.FullName) #Archive Uploaded Files By Date $date = (Get-Date).ToString('MM-dd-yyyy') $path = "C:\foo\bar\uploaded\" + $date #If Today's folder doesn't exist, make one. If(!(test-path $path)) { New-Item -ItemType Directory -Force -Path $path } #Move file to today's folder Move-Item $item.FullName -destination $path }