Make usb network a private connection on windows
- Dominant language
- Python
- Stars
- 186
- Forks
- 26
- PR merge metrics
- No merged PRs in 30d
Description
You can use the following to only run code if it's on windows:
```python
import os
if os.name == 'nt':
```
You can then use powershell to check the status of a network, and mark is as private:
```powershell
Get-NetConnectionProfile
Set-NetConnectionProfile -InterfaceIndex 13 -NetworkCategory Private
```
Python can run powershell in a subprocess, which is probably easiest. I've also written code in the past to use [Python.NET](https://pythonnet.github.io/) to run powershell code within a .NET context that I could give you some pointers from, but that adds more dependencies to your code that you probably don't need.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.