cFosICS is a freeware tool to manage Windows Internet Connection Sharing.
It offers the following command line interface:
cFosICS.exe list - lists all Internet connections available for sharing.
cFosICS.exe share 'public_GUID' 'private_GUID' - creates Internet Connection Sharing for 2 connections, using the GUIDs obtained by the cFosICS.exe list command.
The 'public_GUID' selects the Internet connection which is to be shared, the 'private_GUID' selects the network adapter / connection which shall access the public Internet connection.
cFosICS.exe disable - removes the current configured Internet Connection Sharing.
Newer versions of Windows 10 have a bug which may stop Internet Connection Sharing from working after a reboot.
Therefore cFosICS offers the following additional commands:
cFosICS.exe restart - restarts the Internet Connection Sharing
cFosICS.exe autostart 'delay' - uses the Task Scheduler to call "cFosICS restart" automatically at system boot time, with a delay of 'delay' seconds - starting without delay will not work in most cases. If no 'delay' is specified a default value of 60 is used.
cFosICS.exe uninstall - removes the "cFosICS restart" command from the Task Scheduler
Notice: All commands need to be run as administrator., e.g. in a PowerShell console started with "Run as administrator".