diff --git a/data/module_source/management/Invoke-PSInject.ps1 b/data/module_source/management/Invoke-PSInject.ps1 index 26ab3a410..7d0ffe0c4 100644 --- a/data/module_source/management/Invoke-PSInject.ps1 +++ b/data/module_source/management/Invoke-PSInject.ps1 @@ -112,7 +112,7 @@ Param( write-verbose "replacestart: $replacestart" write-verbose "replaceend: $replaceend" - $NewCode=[System.Text.Encoding]::Unicode.GetString($RawBytes[$replacestart..$replaceend]) + $NewCode=[System.Text.Encoding]::Unicode.GetString($DllBytes[$replacestart..$replaceend]) write-verbose "Replaced pattern with: $NewCode" return $DllBytes