diff options
-rw-r--r-- | PETools/Get-PEHeader.ps1 | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/PETools/Get-PEHeader.ps1 b/PETools/Get-PEHeader.ps1 index 551aac0..2f35292 100644 --- a/PETools/Get-PEHeader.ps1 +++ b/PETools/Get-PEHeader.ps1 @@ -525,12 +525,10 @@ PROCESS { } "@ - $location = [PsObject].Assembly.Location $compileParams = New-Object System.CodeDom.Compiler.CompilerParameters - $assemblyRange = @("System.dll", $location) - $compileParams.ReferencedAssemblies.AddRange($assemblyRange) + $compileParams.ReferencedAssemblies.AddRange(@('System.dll', 'mscorlib.dll')) $compileParams.GenerateInMemory = $True - Add-Type -TypeDefinition $code -passthru -WarningAction SilentlyContinue | Out-Null + Add-Type -TypeDefinition $code -CompilerParameters $compileParams -PassThru -WarningAction SilentlyContinue | Out-Null } function Get-DelegateType |