2

I´m trying to copy a large file (around 180MB) to a remote server using PowerShell Copy-Item.

Copy-Item –Path "$sourcePath" –Destination "$destPath" -Force –ToSession $session 

it works for files of arround 100MB, but i'm having issues with larger files.

This is the error:

Not enough storage is available to complete this operation.


The runspace state is not valid for this operation.

This is the configuration on server side.

Config
    MaxEnvelopeSizekb = 256000
    MaxTimeoutms = 60000
    MaxBatchItems = 32000
    MaxProviderRequests = 4294967295
    Client
        NetworkDelayms = 5000
        URLPrefix = wsman
        AllowUnencrypted = true
        Auth
            Basic = true
            Digest = true
            Kerberos = true
            Negotiate = true
            Certificate = true
            CredSSP = false
        DefaultPorts
            HTTP = 5985
            HTTPS = 5986

Any ideas?

Thanks in advance.

mklement0
  • 382,024
  • 64
  • 607
  • 775
niva rojas
  • 101
  • 1
  • 10
  • from the creator of powershell, [try the bits service for transferring large files](https://devblogs.microsoft.com/powershell/transferring-large-files-using-bits/) – Jawad Jun 03 '20 at 06:02
  • 1
    Use SMB and UNC paths instead of a PSSession. – vonPryz Jun 03 '20 at 07:16
  • Hi vonPryz, SMB is an option that i can´t use for the moment, the server is a instance in AWS, i don´t have a VPN to connect to this instance and i'm behind a proxy also. – niva rojas Jun 03 '20 at 20:33

0 Answers0