
# the original wmi command is deprecated: https://learn.microsoft.com/zh-cn/windows/whats-new/deprecated-features
# here we are going to provide a new wmi command based on powershell object

# https://learn.microsoft.com/zh-cn/windows/win32/wmisdk/wmi-tasks--operating-systems
# https://learn.microsoft.com/zh-cn/powershell/scripting/learn/ps101/07-working-with-wmi?view=powershell-7.3

___x_cmd_pwsh_wmi(){
    local op="$1";  shift
    if ___x_cmd_pwsh_wmi___is_subcmd "$op"; then
        ___x_cmd_pwsh_wmi___subcmd_"$op" "$@"
    else
        pwsh:error "not the subcmd ==> $op"
    fi
}

___x_cmd_pwsh_wmi___is_subcmd(){
    case "$1" in
        alias)                      ;;
        baseboard)                  ;;
        bios)                       ;;
        cdrom)                      ;;
        computersystem)             ;;
        cpu)                        ;;
        csproduct)                  ;;
        datafile)                   ;;
        desktop)                    ;;
        desktopmonitor)             ;;
        diskdrive)                  ;;
        fsdir)                      ;;
        group)                      ;;
        idecontroller)              ;;
        irq)                        ;;
        logicaldisk)                ;;
        memorychip)                 ;;
        netclient)                  ;;
        netlogin)                   ;;
        netprotocol)                ;;
        netuse)                     ;;
        nic)                        ;;
        nicconfig)                  ;;
        ntdomain)                   ;;
        ntevent)                    ;;
        onboarddevice)              ;;
        operatingsystem)            ;;
        pagefile)                   ;;
        pagefileset)                ;;
        partition)                  ;;
        port)                       ;;
        portconnector)              ;;
        printjob)                   ;;
        printer)                    ;;
        process)                    ;;
        product)                    ;;
        qfe)                        ;;
        quickfixengineering)        ;;
        recoveros)                  ;;
        service)                    ;;
        share)                      ;;
        shadowcopy)                 ;;
        sounddev)                   ;;
        startup)                    ;;
        sysdriver)                  ;;
        systemaccount)              ;;
        systembios)                 ;;
        systembootconfiguration)    ;;
        systemdevices)              ;;
        systemenclosure)            ;;
        systemloadordergroup)       ;;
        systemoperatingsystem)      ;;
        systemslot)                 ;;
        systemsystemenclosure)      ;;
        tape)                       ;;
        timezone)                   ;;
        useraccount)                ;;
        userconfig)                 ;;
        videocontroller)            ;;
        voltagesensor)              ;;
        volume)                     ;;
        volumequotas)               ;;
        voltageprobe)               ;;
        wmiset)                     ;;
        worm)                       ;;
        wormdrive)                  ;;

        *)      return 1    ;;
    esac

    return 0
}
