This procedure uses PowerShell reflection to resolve native API functions through Microsoft.Win32.UnsafeNativeMethods, then runs shellcode in the current PowerShell process. The cited PowerSploit implementation allocates executable memory, copies the byte array, and starts a thread in that same process; omitting -ProcessID keeps this scoped to in-process reflective code loading rather than cross-process injection.
Variant:
Inject raw x64 shellcode into a process
powershell
RESTRICTED_ACCESS_BLUR_MARKER
RESTRICTED_ACCESS_BLUR_MARKER
RESTRICTED_ACCESS_BLUR_MARKER
RESTRICTED_ACCESS_BLUR_MARKER