Skip to content

Instantly share code, notes, and snippets.

@vjvelascorios
Created March 6, 2024 14:51
Show Gist options
  • Save vjvelascorios/e8ec3cf18aededa4f185f755ee4374a3 to your computer and use it in GitHub Desktop.
Save vjvelascorios/e8ec3cf18aededa4f185f755ee4374a3 to your computer and use it in GitHub Desktop.
dfin.ps1
# Get date (YYYY-MM-DD)
$fecha = Get-Date -Format "yyyy-MM-dd"
# URL
$url = "https://www.elfinanciero.com.mx/graficos/edicion-impresa/download.php?file=edicion-digital.pdf"
# Download folder
$carpeta_descargas = "C:\Users\vjvelascorios\Desktop\El Financiero"
# Filename
$nombre_archivo = "el_financiero-$fecha.pdf"
# Create folder if it doesn't exist
New-Item -ItemType Directory -Force -Path $carpeta_descargas
# Download file
Invoke-WebRequest -Uri $url -OutFile "$carpeta_descargas\$nombre_archivo"
Write-Host "File downloaded as: $carpeta_descargas\$nombre_archivo"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment