Skip to content

Instantly share code, notes, and snippets.

@asmirbe
Last active June 1, 2022 21:52
Show Gist options
  • Save asmirbe/cac7d2cc50c455acb287767df632d212 to your computer and use it in GitHub Desktop.
Save asmirbe/cac7d2cc50c455acb287767df632d212 to your computer and use it in GitHub Desktop.
:: This gists is for testing purposes only.
:: It is not meant to be used in production.
:: Batch way to scrap XML file from the web with a HTTP GET request in Powershell Invoke-WebRequest.
:: Using Github GISTS as CDN XML file provider
@Echo Off
@setlocal DisableDelayedExpansion
set "_null=1>nul 2>nul"
set "_psc=powershell"
set "_dest=%USERPROFILE%\Solware\list.xml"
%_null %%_psc% "$r = Invoke-WebRequest -Uri 'https://gitcdn.link/cdn/asmirbelkic/b064933ad55335bfde34db9de3ede0d1/raw/fe4160a246757f266d212f52051528431df6867d/list.xml' -Method:Get -ContentType 'application/xml'; $bn = New-Item -Path '%_dest%' -Force; $sc = Set-Content '%_dest%' ($r.Content);"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment