I was trying Invoke-ReflectivePEInjection by doing

Convert-BinaryToString C:\file.exe

But when I run

Invoke-ReflectivePEInjection -PEBytes $PEBytes

I get

Invoke-ReflectivePEInjection : The term 'Invoke-ReflectivePEInjection' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Invoke-ReflectivePEInjection -PEBytes $PEBytes
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Invoke-ReflectivePEInjection:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

What can be the reason?

1 Answer 1


It's part of PowerSploit, which you need to install:

Install-Module -Name PowerSploit

If you've already installed it, you need to import it into your scope using

Import-Module PowerSploit

If you need it regularly, add the above in your $profile script.


Not the answer you're looking for? Browse other questions tagged .