summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/tools/find_powershell.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-03-17 22:50:37 +0800
committerruki <[email protected]>2023-03-17 22:50:37 +0800
commit7cb489300326c7c6b83c7787ed2f8d6d909b4666 (patch)
tree80ae712fea5197a4c95bae2e7ad1e5a31057c871 /xmake/modules/detect/tools/find_powershell.lua
parent879f532bca3c8b56c7a2979c0246ca9ae2a909c2 (diff)
fix find powershell
Diffstat (limited to 'xmake/modules/detect/tools/find_powershell.lua')
-rw-r--r--xmake/modules/detect/tools/find_powershell.lua11
1 files changed, 2 insertions, 9 deletions
diff --git a/xmake/modules/detect/tools/find_powershell.lua b/xmake/modules/detect/tools/find_powershell.lua
index 78cb35afd..d8e1d9ec8 100644
--- a/xmake/modules/detect/tools/find_powershell.lua
+++ b/xmake/modules/detect/tools/find_powershell.lua
@@ -35,20 +35,13 @@ import("lib.detect.find_programver")
-- @endcode
--
function main(opt)
-
- -- init options
opt = opt or {}
- opt.command = opt.command or "--version"
-
- -- find program
+ opt.check = opt.check or {"-c", "$PSVersionTable"}
local program = find_program(opt.program or "powershell", opt)
-
- -- find program version
local version = nil
if program and opt and opt.version then
+ opt.command = opt.command or {"-c", "$PSVersionTable"}
version = find_programver(program, opt)
end
-
- -- ok?
return program, version
end