Guest User

Untitled

a guest
Mar 12th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. remove-item E:Update* -Recurse
  2. #Proxy auth
  3. $Username="daril.aleman"
  4. $Password="MyPassword"
  5. $WebProxy = New-Object
  6. System.Net.WebProxy("http://proxy.example.com:3128",$true)
  7. $url="The.url.of.download.com/file.zip"
  8.  
  9. $client = new-object System.Net.WebClient
  10. $client.Proxy=$Webproxy
  11. $client.proxy.Credentials = New-Object
  12. System.Net.NetworkCredential($Username, $Password)
  13. $client.DownloadFile($url, "E:UpdateDaily_Update.zip")
  14. Set-Location E:Update
  15. $Unzip = New-Object -ComObject Shell.Application
  16. $FileName = "Daily_Update.zip"
  17. $ZipFile = $Unzip.NameSpace((Get-Location).Path + "$FileName")
  18. $Destination = $Unzip.namespace((Get-Location).Path)
  19. $Destination.Copyhere($ZipFile.items())
Add Comment
Please, Sign In to add comment