winrm-fs 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e54c394c912274542248ea943f17cbf8b5801b7
4
- data.tar.gz: 8fa0f2fead6f018f6f22cde2b1109c6fcda72fde
3
+ metadata.gz: 9814f738bc7cc683963e9836d9c72040d440380a
4
+ data.tar.gz: 47fe9476f2564d1b6608afee8466706224176d94
5
5
  SHA512:
6
- metadata.gz: 3d11d2a9ea8715736c3dd9caedfc01ef96a954043896f15e9cd7e164f45b2d8222fe6d0151895c39969e1864347a788009cdd4f6ae83e2041dab02f57deca55d
7
- data.tar.gz: 74dda7732bd2094e698a6651ef1cfc83fd64969c9cba111e8c75dc536133209d8c453a2ebe7eba321a9d049ea9e44d04904b89ba27a14bb1439391149abd997e
6
+ metadata.gz: 0039dfb2837e290525f408461ec8915f29ee05786d5c2e9d411eaff6b92683623865979298530de34dc77e18c83c28b5384a15a58657bc5723e557da94198272
7
+ data.tar.gz: c9fa68c3268fe8b92c51d14a10c238ccf3f68ebc43c6ceb8144c26320d3bf9c6e3a473aaab23499bc15a6e69e046c405e05b5d497e713d3595419660a65b430f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
data/changelog.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # WinRM-fs Gem Changelog
2
+ # 1.0.1
3
+ - Call ClearScriptBlockCache to prevent OutOfMemoryExceptions ClearScriptBlockCache
4
+
2
5
  # 1.0.0
3
6
  - Using winrm v2. File uploads just got a whole lot faster!
4
7
 
@@ -425,6 +425,16 @@ module WinRM
425
425
  [System.io.FileAccess]::Write,
426
426
  [System.IO.FileShare]::ReadWrite
427
427
  )
428
+
429
+ # Powershell caches ScrpitBlocks in a dictionary
430
+ # keyed on the script block text. Thats just great
431
+ # unless the script is super large and called a gillion
432
+ # times like we might do. In such a case it will saturate the
433
+ # Large Object Heap and lead to Out Of Memory exceptions
434
+ # for large files or folders. So we call the internal method
435
+ # ClearScriptBlockCache to clear it.
436
+ $bindingFlags= [Reflection.BindingFlags] "NonPublic,Static"
437
+ $method = [scriptblock].GetMethod("ClearScriptBlockCache", $bindingFlags)
428
438
  EOS
429
439
  )
430
440
 
@@ -443,6 +453,7 @@ module WinRM
443
453
 
444
454
  def stream_command(encoded_bytes)
445
455
  <<-EOS
456
+ if($method) { $method.Invoke($Null, $Null) }
446
457
  $bytes=[Convert]::FromBase64String('#{encoded_bytes}')
447
458
  $fileStream.Write($bytes, 0, $bytes.length)
448
459
  EOS
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: winrm-fs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shawn Neal
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-08-30 00:00:00.000000000 Z
12
+ date: 2016-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: erubis