Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/mason-core/installer/managers/powershell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 4 additions & 3 deletions lua/mason/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ local function check_core_utils()
end

if platform.is.win then
local powershell = vim.fn.executable "pwsh" == 1 and "pwsh" or "powershell"
check {
cmd = "pwsh",
cmd = powershell,
args = {
"-NoProfile",
"-Command",
[[$PSVersionTable.PSVersion, $PSVersionTable.OS, $PSVersionTable.Platform -join " "]],
[[$PSVersionTable.PSVersion, $PSVersionTable.OS, $PSVersionTable.Platform -join ' ']],
},
name = "pwsh",
name = powershell,
}
check { cmd = "7z", args = { "--help" }, name = "7z", relaxed = true }
end
Expand Down
2 changes: 1 addition & 1 deletion tests/mason-core/installer/managers/powershell_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe("powershell manager", function()
"-NoProfile",
"-NonInteractive",
"-Command",
[[ $ErrorActionPreference = "Stop"; $ProgressPreference = 'SilentlyContinue'; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; echo 'Is this bash?']],
[[ $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; echo 'Is this bash?']],
})
end)

Expand Down
Loading