Skip to main content

powershell/wmic to dict

Project description

powershell/wmic to dict

pip install psprocsdict

Tested against Windows 10 / Python 3.11 / Anaconda

from psprocsdict import get_dict_from_command

data = get_dict_from_command(
    cmd=f'powershell "Get-Process | Select-Object Name, Id, PriorityClass, HandleCount, WorkingSet, PagedMemorySize, PrivateMemorySize, VirtualMemorySize, PeakVirtualMemorySize, PeakPagedMemorySize, PeakWorkingSet | Format-Table *"',
    convert_dtypes_with_ast=True,
    format_powershell=False,
    cols=9999999,
    lines=1,
    sep=" ",
    percentage=100,
    stripspaces=True,
)


data2 = get_dict_from_command(
    cmd=f'powershell "Get-Process | Select-Object Name, Id, PriorityClass, HandleCount, WorkingSet, PagedMemorySize, PrivateMemorySize, VirtualMemorySize, PeakVirtualMemorySize, PeakPagedMemorySize, PeakWorkingSet | Format-Table *"',
    convert_dtypes_with_ast=False,
    format_powershell=False,
    cols=9999999,
    lines=1,
    sep=" ",
    percentage=100,
    stripspaces=True,
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

psprocsdict-0.10.tar.gz (21.7 kB view hashes)

Uploaded Source

Built Distribution

psprocsdict-0.10-py3-none-any.whl (21.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page