Skip to content

Commit

Permalink
Merge pull request #96 from elfranne/p95
Browse files Browse the repository at this point in the history
 Powershell scripts should be executed with the -NoProfile parameter
  • Loading branch information
spotter-puppet authored Aug 22, 2024
2 parents 71010ee + 6109c55 commit ac3d5e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/facter/metered_link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
'patching_as_code',
'metered_link.ps1',
)
Facter::Util::Resolution.exec("#{powershell} -ExecutionPolicy Unrestricted -File #{checker_script}").to_s == 'true'
Facter::Util::Resolution.exec("#{powershell} -ExecutionPolicy Bypass -NoProfile -NoLogo -NonInteractive -File #{checker_script}").to_s == 'true'
end
end
2 changes: 1 addition & 1 deletion lib/puppet/type/reboot_if_pending.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def pre_run_check
'patching_as_code',
'pending_reboot.ps1',
)
pending_reboot = Puppet::Util::Execution.execute("#{powershell} -ExecutionPolicy Unrestricted -File #{checker_script}", { failonfail: false }).exitstatus.to_i.zero?
pending_reboot = Puppet::Util::Execution.execute("#{powershell} -ExecutionPolicy Bypass -NoProfile -NoLogo -NonInteractive -File #{checker_script}", { failonfail: false }).exitstatus.to_i.zero?
when 'linux'
# get the script path relative to the Puppet Type
checker_script = File.join(
Expand Down

0 comments on commit ac3d5e7

Please sign in to comment.