1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
"holas" | Out-File fichero222.exe $hash = (Get-FileHash fichero222.exe).hash "fichero222.exe"+","+$hash | Out-File informacion.txt Get-Content .\informacion.txt Compress-Archive .\fichero222.exe -DestinationPath .\fichero222.zip ################### # Si el fichero se ha modificado vuelvo a hacer copia de seguridad ################### "holas2" | Out-File fichero222.exe $hash = (Get-FileHash fichero222.exe).hash $anterior = Get-Content .\informacion.txt if($hash -eq $anterior.split(",")[1]) { "no ha cambiado" } else { Compress-Archive .\fichero222.exe -DestinationPath .\fichero2223.zip } |