Add-Type -AssemblyName System.Runtime.WindowsRuntime $asTaskGeneric = ( [System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' ` -and $_.GetParameters().Count -eq 1 ` -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' } )[0] Function Await($WinRtTask, $ResultType) { $asTask = $asTaskGeneric.MakeGenericMethod($ResultType) $netTask = $asTask.Invoke($null, @($WinRtTask)) $netTask.Wait(-1) | Out-Null $netTask.Result } $connectionProfile = [ Windows.Networking.Connectivity.NetworkInformation, Windows.Networking.Connectivity, ContentType = WindowsRuntime ` ]::GetInternetConnectionProfile() $tetheringManager = [ Windows.Networking.NetworkOperators.NetworkOperatorTetheringManager, Windows.Networking.NetworkOperators, ContentType = WindowsRuntime ` ]::CreateFromConnectionProfile($connectionProfile) $status = $tetheringManager.TetheringOperationalState if ($status -eq "On") { return } Await ($tetheringManager.StartTetheringAsync()) ([Windows.Networking.NetworkOperators.NetworkOperatorTetheringOperationResult])