Created
March 6, 2024 14:51
-
-
Save vjvelascorios/e8ec3cf18aededa4f185f755ee4374a3 to your computer and use it in GitHub Desktop.
dfin.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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