Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Add-Type unsafe

$
0
0

To add C# code unsafe, I'm trying this:

Add-Type -TypeDefinition $code `
    -UsingNamespace 'System.Runtime.InteropServices','System.Text' `
    -CompilerParameters '/unsafe'

But it fails.

PowerShell says -CompilerParameters is wrong.

How should I correct it?

TIA


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>