Rick0

DOWN_KBS_FIM_DO_HORA_VERAO

Oct 31st, 2019
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. New-Item -ItemType Directory -Force -Path $env:systemdrive\KB |out-null
  2. $DestinationFolder ="$env:systemdrive\KB\"
  3. $FilesUrlList = (
  4. "http://download.windowsupdate.com/c/msdownload/update/software/uprl/2019/07/windows6.1-kb4507704-x86_f759e80f628a4b86c57a6ceceac7e8cdc3478881.msu","http://download.windowsupdate.com/c/msdownload/update/software/uprl/2019/07/windows6.1-kb4507704-x64_c79431bd517b2a6728fe1315893e250f00266be6.msu",   #Windows 7 (6.1)-6.1.7601
  5. "http://download.windowsupdate.com/d/msdownload/update/software/uprl/2019/07/windows8.1-kb4507704-x64_f6ff983a9d2e8b9d770741e802bf3e5ffe67c0e5.msu","http://download.windowsupdate.com/d/msdownload/update/software/uprl/2019/07/windows8.1-kb4507704-x86_8c0d1d7a0dd4f6b4c0638c061535f8338fbb99df.msu",   #Windows 8.1 (6.3)-6.2.9200
  6. "http://download.windowsupdate.com/c/msdownload/update/software/updt/2019/07/windows10.0-kb4505903-x64_af8c6ab868423055a750797b6d52c1bd67e15a95.msu","http://download.windowsupdate.com/c/msdownload/update/software/updt/2019/07/windows10.0-kb4505903-x86_52268cd36aed64fbd9ade223fb9256a0c60f3184.msu", #Windows 10 (1903)-10.0.18362
  7. "http://download.windowsupdate.com/d/msdownload/update/software/updt/2019/07/windows10.0-kb4505658-x64_cb660f3191eba56217694635b48d50d36883c3f2.msu","http://download.windowsupdate.com/d/msdownload/update/software/updt/2019/07/windows10.0-kb4505658-x86_d3f8a7b02893e100695b96baf501ddc3127d05c5.msu", #Windows 10 (1809)-10.0.17763
  8. "http://download.windowsupdate.com/d/msdownload/update/software/updt/2019/07/windows10.0-kb4507466-x86_e5313f726a95a494f332e4b5c52f8960a868b87b.msu","http://download.windowsupdate.com/d/msdownload/update/software/updt/2019/07/windows10.0-kb4507466-x64_610af01afaf7e730d6b6b010a1f4bf7dbcc21088.msu", #Windows 10 (1803)-10.0.17134
  9. "http://download.windowsupdate.com/c/msdownload/update/software/updt/2019/07/windows10.0-kb4507465-x86_81992fb3fb03686fa22c934044f538f255aaec14.msu","http://download.windowsupdate.com/c/msdownload/update/software/updt/2019/07/windows10.0-kb4507465-x64_13c9fd41bed4115aa6aee97abd2ea40d245279c6.msu", #Windows 10 (1709)-10.0.16299
  10. "http://download.windowsupdate.com/d/msdownload/update/software/updt/2019/07/windows10.0-kb4507467-x64_d49f6df8f0f14cb7cd6d66b602fb3754f25c0ac9.msu","http://download.windowsupdate.com/c/msdownload/update/software/updt/2019/07/windows10.0-kb4507467-x86_2111d5d4d2c8b9a74458b37e9adb5b2843936958.msu", #Windows 10 (1703)-10.0.15063
  11. "http://download.windowsupdate.com/c/msdownload/update/software/updt/2019/07/windows10.0-kb4507459-x86_0686c650c2a6c6a4e9afed53127a483629d81ae3.msu","http://download.windowsupdate.com/c/msdownload/update/software/updt/2019/07/windows10.0-kb4507459-x64_67d347cdf1933c9da47f7e6f96424ce89debce41.msu"  #Windows 10 (1607)-10.0.14393
  12. )                                                                                                                                                                                                                                                                                                        
  13. function Download()
  14. {
  15.     Import-Module BitsTransfer
  16.     Write-Host "Modulo deTransferencia de Plano de Fundo Carregado"
  17.     Write-Host "Download das atualizacoes KB FIM DO HORARIO DE VERAO WINDOWS 10,8,8.1,7 SP1 (64 E 32 BITS)..."
  18.  
  19.     ForEach ($FileUrl in $FilesUrlList)
  20.     {
  21.         ## Get the file name
  22.         $DestinationFileName = $FileUrl.Split('/')[-1]
  23.    
  24.         Try
  25.         {
  26.            
  27.             ## Retorna true se o arquivo existe, caso esteja ausente retorna false
  28.             If (!(Test-Path "$DestinationFolder\$DestinationFileName"))
  29.             {
  30.                 Write-Host "`'$FileUrl`' ..."
  31.                 Start-BitsTransfer -Source $FileUrl -Destination $DestinationFolder\$DestinationFileName -Priority High -ErrorVariable err
  32.                 If ($err) {Throw ""}
  33.             }
  34.             Else
  35.             {
  36.                 Write-Host "Arquivo $DestinationFileName ja existe, ignorando..."
  37.             }
  38.         }
  39.         Catch
  40.         {
  41.             Write-Warning "Ocorreu um erro ao fazer o download `'$DestinationFileName`'"
  42.             break
  43.         }
  44.     }
  45. }
  46. CLEAR-HOST
  47. Download
Add Comment
Please, Sign In to add comment