+34 911 599 883

+34 911 895 172

12 de febrero de 2014

Configurar powershell y script para borrar los ficheros más antiguos de 15 días

Configurar powershell y script para borrar los ficheros más antiguos de 15 días Ejecutamos:  powershell como administrador Miramos como está configurado: Get-ExecutionPolicy Ejecutamos: Set-ExecutionPolicy RemoteSigned Creamos un fichero.ps1 y editamos: $limit = (Get-Date).AddDays(-15) $path = “C:\directorio” # Delete files older than the $limit. Get-ChildItem -Path $path -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt

Configurar powershell y script para borrar los ficheros más antiguos de 15 días Leer más »