Skip to content

Instantly share code, notes, and snippets.

@j717273419
Created February 28, 2022 03:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j717273419/a95b3adb826078c7d144baf1cf271a1d to your computer and use it in GitHub Desktop.
Save j717273419/a95b3adb826078c7d144baf1cf271a1d to your computer and use it in GitHub Desktop.
win10 / windows 10 auto start hotspot.
$connectionProfile = [Windows.Networking.Connectivity.NetworkInformation,Windows.Networking.Connectivity,ContentType=WindowsRuntime]::GetInternetConnectionProfile()
$tetheringManager = [Windows.Networking.NetworkOperators.NetworkOperatorTetheringManager,Windows.Networking.NetworkOperators,ContentType=WindowsRuntime]::CreateFromConnectionProfile($connectionProfile)
# Start Mobile Hotspot
$tetheringManager.StartTetheringAsync()
# Stop Mobile Hotspot
#$tetheringManager.StopTetheringAsync()
# Check whether Mobile Hotspot is enabled
$tetheringManager.TetheringOperationalState
@j717273419
Copy link
Author

j717273419 commented Feb 28, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment