From 94950242ab21af1b046518adac53b908311d7354 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 7 Sep 2018 14:37:50 -0700 Subject: Properly capitalize PowerShell in descriptions and errors It's PowerShell not Powershell. Our docs site had already been updated. Signed-off-by: Tim Smith --- RELEASE_NOTES.md | 2 +- lib/chef/mixin/powershell_out.rb | 2 +- lib/chef/provider/dsc_resource.rb | 4 ++-- lib/chef/provider/dsc_script.rb | 8 ++++---- lib/chef/provider/package/powershell.rb | 2 +- lib/chef/provider/powershell_script.rb | 6 +++--- lib/chef/resource/dsc_resource.rb | 2 +- lib/chef/resource/powershell_package.rb | 2 +- lib/chef/resource/powershell_package_source.rb | 2 +- lib/chef/util/powershell/cmdlet.rb | 2 +- spec/functional/resource/dsc_resource_spec.rb | 6 +++--- spec/functional/resource/powershell_script_spec.rb | 4 ++-- spec/functional/win32/crypto_spec.rb | 2 +- spec/unit/platform/query_helpers_spec.rb | 8 ++++---- spec/unit/provider/dsc_resource_spec.rb | 4 ++-- spec/unit/provider/dsc_script_spec.rb | 2 +- spec/unit/resource/dsc_resource_spec.rb | 2 +- tasks/templates/prerelease.md.erb | 2 +- 18 files changed, 31 insertions(+), 31 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 09a9d75214..705155bdd1 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1454,7 +1454,7 @@ It is now possible to load Solaris services recursively, by ensuring the new `op This is the inverse of the pre-existing whitelisting functionality. -## The guard interpreter for `powershell_script` is Powershell, again +## The guard interpreter for `powershell_script` is PowerShell, again When writing `not_if` or `only_if` statements, by default we now run those statements using powershell, rather than forcing the user to set `guard_interpreter` each time. diff --git a/lib/chef/mixin/powershell_out.rb b/lib/chef/mixin/powershell_out.rb index 1a757074c2..f910360d36 100644 --- a/lib/chef/mixin/powershell_out.rb +++ b/lib/chef/mixin/powershell_out.rb @@ -86,7 +86,7 @@ class Chef # always set the ExecutionPolicy flag # see http://technet.microsoft.com/en-us/library/ee176961.aspx "-ExecutionPolicy Unrestricted", - # Powershell will hang if STDIN is redirected + # PowerShell will hang if STDIN is redirected # http://connect.microsoft.com/PowerShell/feedback/details/572313/powershell-exe-can-hang-if-stdin-is-redirected "-InputFormat None", ] diff --git a/lib/chef/provider/dsc_resource.rb b/lib/chef/provider/dsc_resource.rb index 3a209a08a1..864373f902 100644 --- a/lib/chef/provider/dsc_resource.rb +++ b/lib/chef/provider/dsc_resource.rb @@ -48,10 +48,10 @@ class Chef def define_resource_requirements requirements.assert(:run) do |a| a.assertion { supports_dsc_invoke_resource? } - err = ["You must have Powershell version >= 5.0.10018.0 to use dsc_resource."] + err = ["You must have PowerShell version >= 5.0.10018.0 to use dsc_resource."] a.failure_message Chef::Exceptions::ProviderNotFound, err - a.whyrun err + ["Assuming a previous resource installs Powershell 5.0.10018.0 or higher."] + a.whyrun err + ["Assuming a previous resource installs PowerShell 5.0.10018.0 or higher."] a.block_action! end requirements.assert(:run) do |a| diff --git a/lib/chef/provider/dsc_script.rb b/lib/chef/provider/dsc_script.rb index fd20f34786..4a44a9ea23 100644 --- a/lib/chef/provider/dsc_script.rb +++ b/lib/chef/provider/dsc_script.rb @@ -63,11 +63,11 @@ class Chef err = [ "Could not find PowerShell DSC support on the system", powershell_info_str, - "Powershell 4.0 or higher was not detected on your system and is required to use the dsc_script resource.", + "PowerShell 4.0 or higher was not detected on your system and is required to use the dsc_script resource.", ] a.assertion { supports_dsc? } a.failure_message Chef::Exceptions::ProviderNotFound, err.join(" ") - a.whyrun err + ["Assuming a previous resource installs Powershell 4.0 or higher."] + a.whyrun err + ["Assuming a previous resource installs PowerShell 4.0 or higher."] a.block_action! end end @@ -175,9 +175,9 @@ class Chef def powershell_info_str if run_context && run_context.node[:languages] && run_context.node[:languages][:powershell] - install_info = "Powershell #{run_context.node[:languages][:powershell][:version]} was found on the system." + install_info = "PowerShell #{run_context.node[:languages][:powershell][:version]} was found on the system." else - install_info = "Powershell was not found." + install_info = "PowerShell was not found." end end end diff --git a/lib/chef/provider/package/powershell.rb b/lib/chef/provider/package/powershell.rb index a65146b1e3..9af1344138 100644 --- a/lib/chef/provider/package/powershell.rb +++ b/lib/chef/provider/package/powershell.rb @@ -37,7 +37,7 @@ class Chef def define_resource_requirements super if powershell_out("$PSVersionTable.PSVersion.Major").stdout.strip.to_i < 5 - raise "Minimum installed Powershell Version required is 5" + raise "Minimum installed PowerShell Version required is 5" end requirements.assert(:install) do |a| a.assertion { candidates_exist_for_all_uninstalled? } diff --git a/lib/chef/provider/powershell_script.rb b/lib/chef/provider/powershell_script.rb index 31521c3675..529ae409d8 100644 --- a/lib/chef/provider/powershell_script.rb +++ b/lib/chef/provider/powershell_script.rb @@ -129,7 +129,7 @@ EOH "-NonInteractive", "-NoProfile", "-ExecutionPolicy #{execution_policy}", - # Powershell will hang if STDIN is redirected + # PowerShell will hang if STDIN is redirected # http://connect.microsoft.com/PowerShell/feedback/details/572313/powershell-exe-can-hang-if-stdin-is-redirected "-InputFormat None", ] @@ -137,10 +137,10 @@ EOH # A wrapper script is used to launch user-supplied script while # still obtaining useful process exit codes. Unless you - # explicitly call exit in Powershell, the powershell.exe + # explicitly call exit in PowerShell, the powershell.exe # interpreter returns only 0 for success or 1 for failure. Since # we'd like to get specific exit codes from executable tools run - # with Powershell, we do some work using the automatic variables + # with PowerShell, we do some work using the automatic variables # $? and $LASTEXITCODE to return the process exit code of the # last process run in the script if it is the last command # executed, otherwise 0 or 1 based on whether $? is set to true diff --git a/lib/chef/resource/dsc_resource.rb b/lib/chef/resource/dsc_resource.rb index bfa282fc11..06c4103bc3 100644 --- a/lib/chef/resource/dsc_resource.rb +++ b/lib/chef/resource/dsc_resource.rb @@ -73,7 +73,7 @@ class Chef property :module_version, String, introduced: "12.21", - description: "The version number of the module to use. Powershell 5.0.10018.0 (or higher) supports having multiple versions of a module installed. This should be specified along with the module_name." + description: "The version number of the module to use. PowerShell 5.0.10018.0 (or higher) supports having multiple versions of a module installed. This should be specified along with the module_name." def property(property_name, value = nil) if not property_name.is_a?(Symbol) diff --git a/lib/chef/resource/powershell_package.rb b/lib/chef/resource/powershell_package.rb index 93fc546357..91e300584f 100644 --- a/lib/chef/resource/powershell_package.rb +++ b/lib/chef/resource/powershell_package.rb @@ -26,7 +26,7 @@ class Chef resource_name :powershell_package provides :powershell_package - description "Use the powershell_package resource to install and manage packages via the Powershell Package Manager for the Microsoft Windows platform. The powershell_package resource requires administrative access, and a source must be configured in the Powershell Package Manager via the Register-PackageSource command" + description "Use the powershell_package resource to install and manage packages via the PowerShell Package Manager for the Microsoft Windows platform. The powershell_package resource requires administrative access, and a source must be configured in the PowerShell Package Manager via the Register-PackageSource command" introduced "12.16" allowed_actions :install, :remove diff --git a/lib/chef/resource/powershell_package_source.rb b/lib/chef/resource/powershell_package_source.rb index 1ed3b895a1..b3bad41f65 100644 --- a/lib/chef/resource/powershell_package_source.rb +++ b/lib/chef/resource/powershell_package_source.rb @@ -24,7 +24,7 @@ class Chef preview_resource true resource_name "powershell_package_source" - description "Use the powershell_package_source resource to register a powershell package repository." + description "Use the powershell_package_source resource to register a PowerShell package repository." introduced "14.3" property :source_name, String, diff --git a/lib/chef/util/powershell/cmdlet.rb b/lib/chef/util/powershell/cmdlet.rb index 6b9ba7c208..480cc61572 100644 --- a/lib/chef/util/powershell/cmdlet.rb +++ b/lib/chef/util/powershell/cmdlet.rb @@ -90,7 +90,7 @@ class Chef result = run(switches, execution_options, arguments) if ! result.succeeded? - raise Chef::Exceptions::PowershellCmdletException, "Powershell Cmdlet failed: #{result.stderr}" + raise Chef::Exceptions::PowershellCmdletException, "PowerShell Cmdlet failed: #{result.stderr}" end result diff --git a/spec/functional/resource/dsc_resource_spec.rb b/spec/functional/resource/dsc_resource_spec.rb index bb3cf2157d..3491bb6bbe 100644 --- a/spec/functional/resource/dsc_resource_spec.rb +++ b/spec/functional/resource/dsc_resource_spec.rb @@ -33,11 +33,11 @@ describe Chef::Resource::DscResource, :windows_powershell_dsc_only do Chef::Resource::DscResource.new("dsc_resource_test", run_context) end - context "when Powershell does not support Invoke-DscResource" - context "when Powershell supports Invoke-DscResource" do + context "when PowerShell does not support Invoke-DscResource" + context "when PowerShell supports Invoke-DscResource" do before do if !Chef::Platform.supports_dsc_invoke_resource?(node) - skip "Requires Powershell >= 5.0.10018.0" + skip "Requires PowerShell >= 5.0.10018.0" elsif !Chef::Platform.supports_refresh_mode_enabled?(node) && !Chef::Platform.dsc_refresh_mode_disabled?(node) skip "Requires LCM RefreshMode is Disabled" end diff --git a/spec/functional/resource/powershell_script_spec.rb b/spec/functional/resource/powershell_script_spec.rb index cc1bd8fd1c..e4c96976d9 100644 --- a/spec/functional/resource/powershell_script_spec.rb +++ b/spec/functional/resource/powershell_script_spec.rb @@ -42,7 +42,7 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do let(:valid_powershell_interpreter_flag) { "-Sta" } let!(:resource) do - r = Chef::Resource::WindowsScript::PowershellScript.new("Powershell resource functional test", @run_context) + r = Chef::Resource::WindowsScript::PowershellScript.new("PowerShell resource functional test", @run_context) r.code(successful_executable_script_content) r end @@ -154,7 +154,7 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do # This somewhat ambiguous case, two failures of different types, # seems to violate the principle of returning the status of the # last line executed -- in this case, we return the status of the - # second to last line. This happens because Powershell gives no + # second to last line. This happens because PowerShell gives no # way for us to determine whether the last operation was a cmdlet # or Windows process. Because the latter gives more specific # errors than 0 or 1, we return that instead, which is acceptable diff --git a/spec/functional/win32/crypto_spec.rb b/spec/functional/win32/crypto_spec.rb index 5fcbca02b6..70d3f42cfb 100644 --- a/spec/functional/win32/crypto_spec.rb +++ b/spec/functional/win32/crypto_spec.rb @@ -36,7 +36,7 @@ describe "Chef::ReservedNames::Win32::Crypto", :windows_only do it "can be decrypted by powershell" do encrypted = Chef::ReservedNames::Win32::Crypto.encrypt(plaintext) - resource = Chef::Resource::WindowsScript::PowershellScript.new("Powershell resource functional test", @run_context) + resource = Chef::Resource::WindowsScript::PowershellScript.new("PowerShell resource functional test", @run_context) resource.code <<~EOF $encrypted = '#{encrypted}' | ConvertTo-SecureString $BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($encrypted) diff --git a/spec/unit/platform/query_helpers_spec.rb b/spec/unit/platform/query_helpers_spec.rb index 82ed4de9c6..22bfd150ee 100644 --- a/spec/unit/platform/query_helpers_spec.rb +++ b/spec/unit/platform/query_helpers_spec.rb @@ -139,13 +139,13 @@ describe "Chef::Platform#supports_msi?" do end describe "Chef::Platform#supports_dsc?" do - it "returns false if powershell is not present" do + it "returns false if PowerShell is not present" do node = Chef::Node.new expect(Chef::Platform.supports_dsc?(node)).to be_falsey end ["1.0", "2.0", "3.0"].each do |version| - it "returns false for Powershell #{version}" do + it "returns false for PowerShell #{version}" do node = Chef::Node.new node.automatic[:languages][:powershell][:version] = version expect(Chef::Platform.supports_dsc?(node)).to be_falsey @@ -153,7 +153,7 @@ describe "Chef::Platform#supports_dsc?" do end ["4.0", "5.0"].each do |version| - it "returns true for Powershell #{version}" do + it "returns true for PowerShell #{version}" do node = Chef::Node.new node.automatic[:languages][:powershell][:version] = version expect(Chef::Platform.supports_dsc?(node)).to be_truthy @@ -168,7 +168,7 @@ describe "Chef::Platform#supports_dsc_invoke_resource?" do end ["1.0", "2.0", "3.0", "4.0", "5.0.10017.9"].each do |version| - it "returns false for Powershell #{version}" do + it "returns false for PowerShell #{version}" do node = Chef::Node.new node.automatic[:languages][:powershell][:version] = version expect(Chef::Platform.supports_dsc_invoke_resource?(node)).to be_falsey diff --git a/spec/unit/provider/dsc_resource_spec.rb b/spec/unit/provider/dsc_resource_spec.rb index 411dc50cc9..82ee5a40b3 100644 --- a/spec/unit/provider/dsc_resource_spec.rb +++ b/spec/unit/provider/dsc_resource_spec.rb @@ -27,7 +27,7 @@ describe Chef::Provider::DscResource do Chef::Provider::DscResource.new(resource, run_context) end - context "when Powershell does not support Invoke-DscResource" do + context "when PowerShell does not support Invoke-DscResource" do let (:node) do node = Chef::Node.new node.automatic[:languages][:powershell][:version] = "4.0" @@ -40,7 +40,7 @@ describe Chef::Provider::DscResource do end end - context "when Powershell supports Invoke-DscResource" do + context "when PowerShell supports Invoke-DscResource" do context "when RefreshMode is not set to Disabled" do context "and the WMF 5 is a preview release" do diff --git a/spec/unit/provider/dsc_script_spec.rb b/spec/unit/provider/dsc_script_spec.rb index 5f091b8813..c880683a0f 100644 --- a/spec/unit/provider/dsc_script_spec.rb +++ b/spec/unit/provider/dsc_script_spec.rb @@ -162,7 +162,7 @@ describe Chef::Provider::DscScript do end end - it "raises an exception if Powershell is not present" do + it "raises an exception if PowerShell is not present" do expect do provider.run_action(:run) end.to raise_error(Chef::Exceptions::ProviderNotFound) diff --git a/spec/unit/resource/dsc_resource_spec.rb b/spec/unit/resource/dsc_resource_spec.rb index 22c42aa441..04e1305163 100644 --- a/spec/unit/resource/dsc_resource_spec.rb +++ b/spec/unit/resource/dsc_resource_spec.rb @@ -93,7 +93,7 @@ describe Chef::Resource::DscResource do end end - context "Powershell DSL methods" do + context "PowerShell DSL methods" do it "responds to :ps_credential" do expect(dsc_test_resource.respond_to?(:ps_credential)).to be true end diff --git a/tasks/templates/prerelease.md.erb b/tasks/templates/prerelease.md.erb index 6d45d25ab8..cab7f11fff 100644 --- a/tasks/templates/prerelease.md.erb +++ b/tasks/templates/prerelease.md.erb @@ -21,7 +21,7 @@ Alternatively, you can install Chef using one of the following command options: # In Shell $ curl https://omnitruck.chef.io/install.sh | sudo bash -s -- -P chef -v <%= @version %> -c current -# In Windows Powershell +# In Windows PowerShell . { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install -project chef -version <%= @version %> -channel current ``` -- cgit v1.2.1