Skip to content

Commit ac3d5e7

Browse files
authoredAug 22, 2024
Merge pull request #96 from elfranne/p95
Powershell scripts should be executed with the -NoProfile parameter
2 parents 71010ee + 6109c55 commit ac3d5e7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎lib/facter/metered_link.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
'patching_as_code',
1212
'metered_link.ps1',
1313
)
14-
Facter::Util::Resolution.exec("#{powershell} -ExecutionPolicy Unrestricted -File #{checker_script}").to_s == 'true'
14+
Facter::Util::Resolution.exec("#{powershell} -ExecutionPolicy Bypass -NoProfile -NoLogo -NonInteractive -File #{checker_script}").to_s == 'true'
1515
end
1616
end

‎lib/puppet/type/reboot_if_pending.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def pre_run_check
3838
'patching_as_code',
3939
'pending_reboot.ps1',
4040
)
41-
pending_reboot = Puppet::Util::Execution.execute("#{powershell} -ExecutionPolicy Unrestricted -File #{checker_script}", { failonfail: false }).exitstatus.to_i.zero?
41+
pending_reboot = Puppet::Util::Execution.execute("#{powershell} -ExecutionPolicy Bypass -NoProfile -NoLogo -NonInteractive -File #{checker_script}", { failonfail: false }).exitstatus.to_i.zero?
4242
when 'linux'
4343
# get the script path relative to the Puppet Type
4444
checker_script = File.join(

0 commit comments

Comments
 (0)