Squeeze a few more bytes out of put_file script.
This commit is contained in:
parent
8816ebb3f8
commit
8a121fd6ae
1 changed files with 4 additions and 4 deletions
|
@ -158,11 +158,11 @@ class Connection(object):
|
|||
in_size = os.path.getsize(in_path)
|
||||
script_template = '''
|
||||
$s = [System.IO.File]::OpenWrite("%s");
|
||||
$s.Seek(%d, [System.IO.SeekOrigin]::Begin) | Out-Null;
|
||||
[void]$s.Seek(%d, [System.IO.SeekOrigin]::Begin);
|
||||
$b = [System.Convert]::FromBase64String("%s");
|
||||
$s.Write($b, 0, $b.length) | Out-Null;
|
||||
$s.SetLength(%d) | Out-Null;
|
||||
$s.Close() | Out-Null;
|
||||
[void]$s.Write($b, 0, $b.length);
|
||||
[void]$s.SetLength(%d);
|
||||
[void]$s.Close();
|
||||
'''
|
||||
# Determine max size of data we can pass per command.
|
||||
script = script_template % (powershell._escape(out_path), in_size, '', in_size)
|
||||
|
|
Loading…
Reference in a new issue