From 3b03644c04278ec49871906a78cb9d22f24790f9 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 18 Aug 2023 08:49:15 +0200 Subject: [PATCH] rubocop: autofix --- lib/puppet/provider/windowsfeature/default.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/puppet/provider/windowsfeature/default.rb b/lib/puppet/provider/windowsfeature/default.rb index f859735..4643224 100644 --- a/lib/puppet/provider/windowsfeature/default.rb +++ b/lib/puppet/provider/windowsfeature/default.rb @@ -10,10 +10,10 @@ confine :kernel => :windows # powershell, powershell, powershell. where to find it. commands :ps => - if File.exist?("#{ENV['SYSTEMROOT']}\\sysnative\\WindowsPowershell\\v1.0\\powershell.exe") - "#{ENV['SYSTEMROOT']}\\sysnative\\WindowsPowershell\\v1.0\\powershell.exe" - elsif File.exist?("#{ENV['SYSTEMROOT']}\\system32\\WindowsPowershell\\v1.0\\powershell.exe") - "#{ENV['SYSTEMROOT']}\\system32\\WindowsPowershell\\v1.0\\powershell.exe" + if File.exist?("#{ENV.fetch('SYSTEMROOT', nil)}\\sysnative\\WindowsPowershell\\v1.0\\powershell.exe") + "#{ENV.fetch('SYSTEMROOT', nil)}\\sysnative\\WindowsPowershell\\v1.0\\powershell.exe" + elsif File.exist?("#{ENV.fetch('SYSTEMROOT', nil)}\\system32\\WindowsPowershell\\v1.0\\powershell.exe") + "#{ENV.fetch('SYSTEMROOT', nil)}\\system32\\WindowsPowershell\\v1.0\\powershell.exe" else 'powershell.exe' end