1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#Cifrar el contenido del fichero $fichero="fichero.txt" $cifrado=gc $fichero $clavecifrado=1 $textocifrado=(0..($cifrado.Length-1) | % {[char]::ConvertFromUtf32([char]::ConvertToUtf32($cifrado[$_].ToString(),0)+$clavecifrado)}) -join "" #Cifrar el nombre y añadir el contenido cifrado #Quitamos los puntos y otros caracteres para no tener errores a la hora de crear el nuevo fichero cifrado $ficherosin=$fichero.Replace(".","") $ficherocifrado=(0..($ficherosin.Length-1) | % {[char]::ConvertFromUtf32([char]::ConvertToUtf32($ficherosin[$_].ToString(),0)+$clavecifrado)}) -join "" $textocifrado | Out-File $ficherocifrado #Subir un fichero por SSH a un servidor Linux desde PowerShell en Windows Set-SCPFile -LocalFile $ficherocifrado -ComputerName 192.168.1.162 -RemotePath . -Credential (Get-Credential) |