Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

Monthly Archives: September 2020

Download Files Using Command in Windows Server Core 2016

I have a Windows Server 2016 in Core mode, i.e. most of the GUI programs are not available.

Steps:

1. Set the SecurityProtocol. It is required for https:

[Net.ServicePointManager]::SecurityProtocol = 
  [Net.SecurityProtocolType]::Tls12 -bor `
  [Net.SecurityProtocolType]::Tls11 -bor `
  [Net.SecurityProtocolType]::Tls

2. The actual command, iwr, is an alias of Invoke-WebRequest :

iwr -outf filename https://example.com

References:

  1. https://superuser.com/a/755581/328810
  2. https://stackoverflow.com/a/48030563/350580