Skip to content

Instantly share code, notes, and snippets.

@idwpan
idwpan / update_qbit_port_protonvpn.ps1
Last active March 26, 2025 12:57
PowerShell script to auto update the qBittorrent listening port when ProtonVPN is connected
########################################################################################################################
# Script to Synchronize qBittorrent Listening Port with ProtonVPN assigned port on Windows.
#
# Description:
# This PowerShell script automates the synchronization of qBittorrent's listening port with the
# port number assigned by ProtonVPN's port forwarding feature. It continuously monitors the
# system to check if ProtonVPN is connected and if qBittorrent is running. When both conditions
# are met, it retrieves the latest port number from ProtonVPN's notifications and updates
# qBittorrent's listening port via its Web API if there's a mismatch.
#