Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

Commit bee8ff4

Browse files
committed
Fixed Windows get OS version.
1 parent 172c77f commit bee8ff4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

platform/windows/functions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ get_current_hostname(){
234234
get_pc_info(){
235235

236236
pc_name=$(get_current_hostname)
237-
pc_os_version=$(echo 'os get version' | wmic 2> /dev/null | tail -1)
237+
pc_os_version=$(echo 'os get version' | wmic 2> /dev/null | grep -i version -A1 | tail -1)
238238

239239
local chassis_type=`echo 'systemenclosure get ChassisTypes' | wmic 2> /dev/null | grep '{' | sed 's/[^0-9]//g'`
240240
if [[ $chassis_type == "8" || $chassis_type == "9" || $chassis_type == "10" || $chassis_type == "11" || $chassis_type == "14" ]]; then
@@ -245,4 +245,4 @@ get_pc_info(){
245245

246246
rm -f "$base_path/TempWmicBatchFile.bat" 2> /dev/null
247247

248-
}
248+
}

0 commit comments

Comments
 (0)