diff --git a/lua/mason-core/managers/powershell/init.lua b/lua/mason-core/managers/powershell/init.lua index 0e7f41454..372426e8e 100644 --- a/lua/mason-core/managers/powershell/init.lua +++ b/lua/mason-core/managers/powershell/init.lua @@ -8,7 +8,7 @@ local M = {} local PWSHOPT = { progress_preference = [[ $ProgressPreference = 'SilentlyContinue'; ]], -- https://stackoverflow.com/a/63301751 security_protocol = [[ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ]], - error_action_preference = [[ $ErrorActionPreference = "Stop"; ]], + error_action_preference = [[ $ErrorActionPreference = 'Stop'; ]], } local powershell = _.lazy(function() diff --git a/lua/mason/health.lua b/lua/mason/health.lua index b8680ad4a..8fd27ed9d 100644 --- a/lua/mason/health.lua +++ b/lua/mason/health.lua @@ -155,13 +155,13 @@ local function check_core_utils() if platform.is.win then check { - cmd = "pwsh", + cmd = (vim.fn.executable "pwsh" == 1 and "pwsh" or "powershell"), args = { "-NoProfile", "-Command", - [[$PSVersionTable.PSVersion, $PSVersionTable.OS, $PSVersionTable.Platform -join " "]], + [[$PSVersionTable.PSVersion, $PSVersionTable.OS, $PSVersionTable.Platform -join ' ']], }, - name = "pwsh", + name = (vim.fn.executable "pwsh" == 1 and "pwsh" or "powershell") -- mason switched back to a powershell default } check { cmd = "7z", args = { "--help" }, name = "7z", relaxed = true } end