Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ def munge_psmodulepath(resource)
<<~MUNGE_PSMODULEPATH.strip
$UnmungedPSModulePath = [System.Environment]::GetEnvironmentVariable('PSModulePath','machine')
$MungedPSModulePath = $env:PSModulePath + ';#{vendor_path}'
[System.Environment]::SetEnvironmentVariable('PSModulePath', $MungedPSModulePath, [System.EnvironmentVariableTarget]::Machine)
Set-ItemProperty -Path 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment' -Name 'PSModulePath' -Value $MungedPSModulePath
$env:PSModulePath = [System.Environment]::GetEnvironmentVariable('PSModulePath','machine')
MUNGE_PSMODULEPATH
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Try {
} Finally {
If (![string]::IsNullOrEmpty($UnmungedPSModulePath)) {
# Reset the PSModulePath
[System.Environment]::SetEnvironmentVariable('PSModulePath', $UnmungedPSModulePath, [System.EnvironmentVariableTarget]::Machine)
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' -Name 'PSModulePath' -Value $UnmungedPSModulePath
$env:PSModulePath = [System.Environment]::GetEnvironmentVariable('PSModulePath', 'machine')
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,8 @@
end

it 'updates the system PSModulePath to $MungedPSModulePath' do
expect(result).to match(/SetEnvironmentVariable\('PSModulePath', \$MungedPSModulePath/)
-Name 'PSModulePath' -Value $MungedPSModulePath

Check failure on line 1532 in spec/unit/puppet/provider/dsc_base_provider/dsc_base_provider_spec.rb

View workflow job for this annotation

GitHub Actions / spec (ruby 2.7 | puppet ~> 7.0) / spec

Lint/Syntax: unexpected token tSTRING (Using Ruby 2.7 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)

Check failure on line 1532 in spec/unit/puppet/provider/dsc_base_provider/dsc_base_provider_spec.rb

View workflow job for this annotation

GitHub Actions / spec (ruby 2.7 | puppet ~> 7.0) / spec

Lint/Syntax: unexpected token tGVAR (Using Ruby 2.7 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)

Check failure on line 1532 in spec/unit/puppet/provider/dsc_base_provider/dsc_base_provider_spec.rb

View workflow job for this annotation

GitHub Actions / spec (ruby 3.2 | puppet ~> 8.0) / spec

Lint/Syntax: unexpected token tSTRING (Using Ruby 2.7 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)

Check failure on line 1532 in spec/unit/puppet/provider/dsc_base_provider/dsc_base_provider_spec.rb

View workflow job for this annotation

GitHub Actions / spec (ruby 3.2 | puppet ~> 8.0) / spec

Lint/Syntax: unexpected token tGVAR (Using Ruby 2.7 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)
expect(result).to match(/-Name 'PSModulePath' -Value \$MungedPSModulePath/)
end

it 'sets the process level PSModulePath to the modified system PSModulePath' do
Expand Down
Loading