Skip to content

Commit 4cc9022

Browse files
Update Invoke-EncryptedZip.ps1
1 parent 39f5b8f commit 4cc9022

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Invoke-EncryptedZip.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,9 @@ function Decrypt-AESFileStream {
10391039

10401040
End {
10411041
$len = (Get-Item "$FileName").length
1042-
$size = Convert-Size -Size $len
1042+
# TODO: re write the add-type before using this
1043+
# $size = Convert-Size -Size $len
1044+
$size = $len
10431045
Write-Verbose "[*] Final decrypted file size: $size"
10441046
$Result = New-Object –TypeName PSObject
10451047
$Result | Add-Member –MemberType NoteProperty –Name Computer –Value $env:COMPUTERNAME
@@ -1104,7 +1106,7 @@ Function Convert-Size {
11041106
[DllImport("Shlwapi.dll", CharSet = CharSet.Auto)]
11051107
public static extern long StrFormatByteSize( long fileSize, System.Text.StringBuilder buffer, int bufferSize );
11061108
"@
1107-
$Global:ConvertSize = Add-Type -Name SizeConverter -MemberDefinition $Signature -PassThru
1109+
$Global:ConvertSize = [System.Reflection.Assembly]::LoadWithPartialName(
11081110
}
11091111
Write-Verbose ("[*] Building buffer for string")
11101112
$stringBuilder = New-Object Text.StringBuilder 1024

0 commit comments

Comments
 (0)