1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
function pasarfecha($fecha,$palabra) { mkdir $fecha.ToString("yyyyMMdd") cd $fecha.ToString("yyyyMMdd") switch($palabra) { "procesos"{Get-Process | Out-File procesos.txt} "servicios"{Get-Service | Out-File servicios.txt} "hilo"{(Get-Process).Threads.id | Out-File servicios.txt} } cd .. } pasarfecha (Get-Date) procesos |