ruby-pwsh 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bdcbcec4cceaa40f4fabaad50f9d7409382c14eb1a98a345af5770aa1ae78f31
4
- data.tar.gz: 48f16a70a2305b398a9098d453ae743a6c2630a94cdc8d6716250e1e4ee83464
3
+ metadata.gz: c0192c9fd1e6f719c01cfbc185c847943ec0878c1fbfda56749a52dfd5d7fca7
4
+ data.tar.gz: 5d40c16d7f2efe2585a0c65d0e6050aaa72e4083510cbac376038a85ec725264
5
5
  SHA512:
6
- metadata.gz: 7c19486fd5452d81c71e7939fddaa78c66972ddb425806fc894b1aeecf0cb94b917955d29245130095ee5c4c85d63f2ba12176b6ef8fe4ce7e6f9f653bb0224c
7
- data.tar.gz: b12c1ab52269745152a29ce446876a3e06f3b9f9aab1d254157d8f93c6cccb1e7f997c118488229e22d8800a1a1a17af0557a8c0af2ea386d3e80e80c2f5bfd0
6
+ metadata.gz: 1e1356eb57e96fa78906861bdd6bf887c5f9eb14175f5408e4db779a3b66ac1bc9bf92d1436f36d019da8b3e18f0bfbc175170d8e3058eff6c3e51235b433ac0
7
+ data.tar.gz: de4bdce317e05453eb9179df50f065c09c16da4529b304ed0adb7e4becc3c8378ea0f67d69444209ac72d6a5f19881b594f624c311412e8fa32fdcb4bdb9b34d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).
4
4
 
5
+ ## [v0.10.2](https://github.com/puppetlabs/ruby-pwsh/tree/v0.10.2) - 2022-06-24
6
+
7
+ [Full Changelog](https://github.com/puppetlabs/ruby-pwsh/compare/0.10.1...v0.10.2)
8
+
9
+ ### Fixed
10
+
11
+ - (GH-188) Filter current environment variables [#189](https://github.com/puppetlabs/ruby-pwsh/pull/189) ([chelnak](https://github.com/chelnak))
12
+
5
13
  ## [0.10.1](https://github.com/puppetlabs/ruby-pwsh/tree/0.10.1) (2021-08-23)
6
14
 
7
15
  [Full Changelog](https://github.com/puppetlabs/ruby-pwsh/compare/0.10.0...0.10.1)
data/Rakefile CHANGED
@@ -170,7 +170,7 @@ namespace :dsc do
170
170
  # Note: This only works for modules in the dsc namespace on the forge.
171
171
  puppetized_dsc_modules = [
172
172
  { name: 'powershellget', version: '2.2.5-0-1' },
173
- { name: 'jeadsc', version: '0.7.2-0-2' }, # update to 0.7.2-0-3 on release
173
+ { name: 'jeadsc', version: '0.7.2-0-3' },
174
174
  { name: 'xpsdesiredstateconfiguration', version: '9.1.0-0-1' },
175
175
  { name: 'xwebadministration', version: '3.2.0-0-2' },
176
176
  { name: 'accesscontroldsc', version: '1.4.1-0-3' }
data/lib/pwsh/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Pwsh
4
4
  # The version of the ruby-pwsh gem
5
- VERSION = '0.10.1'
5
+ VERSION = '0.10.2'
6
6
  end
data/lib/pwsh.rb CHANGED
@@ -406,7 +406,7 @@ Invoke-PowerShellUserCode @params
406
406
  #
407
407
  # @return[String] Unique string representing the manager instance.
408
408
  def self.instance_key(cmd, args, options)
409
- cmd + args.join(' ') + options[:debug].to_s
409
+ cmd + args.join(' ') + options.to_s
410
410
  end
411
411
 
412
412
  # Return whether or not a particular stream is valid and readable
@@ -35,8 +35,18 @@ $global:ourFunctions = @'
35
35
  function Reset-ProcessEnvironmentVariables {
36
36
  param($CachedEnvironmentVariables)
37
37
 
38
+ # When Protected Event Logging and PowerShell Script Block logging are enabled together
39
+ # the SystemRoot environment variable is a requirement. If it is removed as part of this purge
40
+ # it causes the PowerShell process to crash, therefore breaking the pipe between Ruby and the
41
+ # remote PowerShell session.
42
+ # The least descructive way to avoid this is to filter out SystemRoot when pulling our current list
43
+ # of environment variables. Then we can continue safely with the removal.
44
+ $CurrentEnvironmentVariables = Get-ChildItem -Path Env:\* |
45
+ Where-Object {$_.Name -ne "SystemRoot"}
46
+
38
47
  # Delete existing environment variables
39
- Remove-Item -Path Env:\* -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -Recurse
48
+ $CurrentEnvironmentVariables |
49
+ ForEach-Object -Process { Remove-Item -Path "ENV:\$($_.Name)" -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -Recurse }
40
50
 
41
51
  # Re-add the cached environment variables
42
52
  $CachedEnvironmentVariables |
data/metadata.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "puppetlabs-pwshlib",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "author": "puppetlabs",
5
5
  "summary": "Provide library code for interoperating with PowerShell.",
6
6
  "license": "MIT",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-pwsh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet, Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-23 00:00:00.000000000 Z
11
+ date: 2022-06-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: PowerShell code manager for ruby.
14
14
  email:
@@ -54,7 +54,7 @@ metadata:
54
54
  homepage_uri: https://github.com/puppetlabs/ruby-pwsh
55
55
  source_code_uri: https://github.com/puppetlabs/ruby-pwsh
56
56
  changelog_uri: https://github.com/puppetlabs/ruby-pwsh
57
- post_install_message:
57
+ post_install_message:
58
58
  rdoc_options: []
59
59
  require_paths:
60
60
  - lib
@@ -69,8 +69,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  requirements: []
72
- rubygems_version: 3.2.17
73
- signing_key:
72
+ rubygems_version: 3.0.3.1
73
+ signing_key:
74
74
  specification_version: 4
75
75
  summary: PowerShell code manager for ruby.
76
76
  test_files: []