mirror of
https://github.com/bin456789/reinstall.git
synced 2026-05-21 05:27:41 +08:00
core: 优化 powershell 查询
- 避免 wmic where 条件有空格时报错 - 减少 ForEach-Object 以提高速度
This commit is contained in:
@ -643,13 +643,12 @@ wmic() {
|
||||
curl -Lo "$tmp/wmic.ps1" "$confhome/wmic.ps1"
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2046
|
||||
powershell -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass \
|
||||
-File "$(cygpath -w "$tmp/wmic.ps1")" \
|
||||
-Namespace "$namespace" \
|
||||
-Class "$class" \
|
||||
$([ -n "$filter" ] && echo -Filter "$filter") \
|
||||
$([ -n "$props" ] && echo -Properties "$props")
|
||||
${filter:+"-Filter"} ${filter:+"$filter"} \
|
||||
${props:+"-Properties"} ${props:+"$props"}
|
||||
}
|
||||
|
||||
is_virt() {
|
||||
|
||||
Reference in New Issue
Block a user