New-NetNat support check not working as intended
See original GitHub issueFirst off let me thank you for making this application. I only found it yesterday but managed to get a WireGuard server running in under an hour.
Now onto the issue at hand.
In commit eb22d730ab70ae5638a010128a70841d5e4464fe a support check for New-NetNat was introduced. This support check fails on my machine even though New-NetNat is supported. Running the support check in powershell yields the following output:
PS C:\WINDOWS\system32> Get-Help New-NetNat -Parameter InternalIPInterfaceAddressPrefix
Get-Help : Kein Parameter entspricht dem Kriterium "InternalIPInterfaceAddressPrefix".
In Zeile:1 Zeichen:1
+ Get-Help New-NetNat -Parameter InternalIPInterfaceAddressPrefix
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (System.Manageme...CommandHelpInfo:ProviderCommandHelpInfo) [Get-Help],
PSArgumentException
+ FullyQualifiedErrorId : NoParmsFound,Microsoft.PowerShell.Commands.GetHelpCommand
Get-Help fails to find information about the InternalIPInterfaceAddressPrefix parameter and gives an exit code other than 0. Running the commands to manually set up NAT routing works fine however and no errors occur. After rewriting the support check and letting it do the setup everything worked fine aswell. I have pushed my changes to https://github.com/Dola-Shuvi/WgServerforWindows/commit/41413db1a86a4dbde74a3cba317c761da64b4f8e for you to take a look at.
My Windows version is 22H2 (Build 19045.2130) and I installed everything except the Hyper-V-Hypervisor and the GUI manager in the add/remove Windows features menu.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)

Top Related StackOverflow Question
Looks good to me. The fallback works as expected and should make the support check much more robust.
Ooh this is great, nice find! Relying on
Get-Helpwas probably always a bad idea. 😄Unfortunately, that command returns
0whether or not the parameter exists, but this seems to do the trick.Would you be willing to test it for me before I make a new release? I’ve pushed the change to fix/62. I can also generate a build for you, but it sounds like you know how to do that. 😊