Skip to main content

Manage Microsoft Defender path exclusions from a Windows command line.

Project description

py-win-mp-exclude

py-win-mp-exclude is a Windows command line tool for adding, removing, and listing Microsoft Defender path exclusions.

The tool uses PowerShell's Defender cmdlets:

  • Add-MpPreference -ExclusionPath
  • Remove-MpPreference -ExclusionPath
  • Get-MpPreference

When an add or remove command starts without administrator privileges, the program relaunches itself once through py-admin-launch. A hidden startup flag prevents repeated elevation attempts.

Installation

pip install py-win-mp-exclude

Usage

Add a file or folder exclusion:

win-mp-exclude add C:\path\to\file.exe
win-mp-exclude add C:\path\to\folder

Remove a file or folder exclusion:

win-mp-exclude remove C:\path\to\file.exe
win-mp-exclude remove C:\path\to\folder

List configured path exclusions:

win-mp-exclude list

Preview the PowerShell command without running it:

win-mp-exclude --dry-run add C:\path\to\folder

The package also installs the alias py-win-mp-exclude.

Development

Build with Poetry:

poetry build

Publish with Poetry:

poetry publish

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

py_win_mp_exclude-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_win_mp_exclude-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file py_win_mp_exclude-0.1.0.tar.gz.

File metadata

  • Download URL: py_win_mp_exclude-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10

File hashes

Hashes for py_win_mp_exclude-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c7adee0125f68cd3b3d8b912d66135dbc0a2cdcf5945ecb6cf2c5cbc78aab4f2
MD5 36cdd3d6938113fe5cef2cb09134dea3
BLAKE2b-256 d84534210e40366cdddea2290c3391eb2765b8def8247f723dce2c303431cd56

See more details on using hashes here.

File details

Details for the file py_win_mp_exclude-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: py_win_mp_exclude-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10

File hashes

Hashes for py_win_mp_exclude-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd41517e0c9f92a06f03c608bd68a6e482b10df57b170fdd0b64277a580bdd74
MD5 7c0d7e303afc6f134804a55630b0c004
BLAKE2b-256 47ea5df0e62d5c2cac56ff5ea4e02d190aa5bcfc937875c54f116c58e21e9afe

See more details on using hashes here.

Supported by

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