# shellcheck shell=dash
___x_cmd_pwsh_lsof(){
    local cmd=
    local x_output_mode=; local x_output=
    case "$1" in
        info)       cmd="Get-ComputerInfo";         shift ;;
        net)        cmd="Get-NetconnectionProfile"; shift ;;
        psdrive)    cmd="Get-PSDrive";              shift ;;
        time)       cmd="Get-TimeZone";             shift ;;
        -h|--help)  ___x_cmd help -m pwsh lsof;     return ;;
        *)          N=pwsh M="Unsupported subcmd => $1" log:ret:64  ;;
    esac

    pwsh:arg:null

    while [ $# -gt 0 ]; do
        pwsh:output:mode:all
    done

    [ "$x_output_mode" != app ] || {
        ___x_cmd_pwsh___exec "$x_output_mode" "$cmd" "$x_output" | ___x_cmd csv --app
        return
    }

    ___x_cmd_pwsh___exec "$x_output_mode" "$cmd" "$x_output"
}
