Last active
December 4, 2018 14:50
-
-
Save thecliguy/0422a7b1fc7042dc55b4374a7a1305ff to your computer and use it in GitHub Desktop.
Upload Binary
This file contains hidden or 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
$sourcefile = read-host "Enter source file path" | |
$destfile = read-host "Enter destination file path" | |
$content = Get-Content -Path $sourcefile -Encoding Byte | |
$Base64 = [System.Convert]::ToBase64String($Content) | |
Invoke-Command -computername <computername> -credential (get-credential) -scriptblock {$x = [System.Convert]::FromBase64String($Using:Base64); Set-Content -Path $using:destfile -Value $x -Encoding Byte} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment