Out Of Memory while compiling method

Welcome Forums General PowerShell Q&A Out Of Memory while compiling method

This topic contains 1 reply, has 2 voices, and was last updated by

4 years, 4 months ago.

  • Author
  • #19852

    Points: 1
    Rank: Member

    While running a command like this one

    Invoke-Command -ComputerName remotemachine -Credential $cred -scriptBlock {& C:\Windows\Microsoft.Net\Framework64\v4.0.30319\ngen.exe install C:\Assemblies\my.dll /verbose}

    we encounter this error "Out Of Memory while compiling method ..."

    If we run the command locally on the remotemachine it works fine.

    Anyone have any suggestions?

  • #19853

    Points: 0
    Rank: Member


    You might be running out of memory in the remote session, try the following:

    Get-Item wsman:localhost\Shell\MaxMemoryPerShellMB

    You can then set the maxvalue with this command and see if it helps:

    Set-Item wsman:localhost\Shell\MaxMemoryPerShellMB 1024

    Where 1024 is an example value.


The topic ‘Out Of Memory while compiling method’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort