I’d like to write a short PowerShell Script where firstly a list of network adapters appear, thereafter the User has to select one of these networks and after that the NetworkCategory is switched to private.
Right now I’m doing this manually with the commands
Get-NetconnectionProfile
and
Set-NetconnectionProfile
This works fine to me but this process is used by different Users on different PCs with different “InterfaceIndices” or “NetworkNames” so I’d like to make it a bit more Userfriendly and automatically.
I’m very new to PowerShell so I’ve no idea were to start. Any suggestions?
I tried this to show the available Networks, but I don’t know how to make a User seleciton out of this:
$net = Get-NetConnectionProfile
for ( $index = 0; $index -lt $net.count; $index++)
{
" [{0}]" -f $index+ $Tab +$net[$index].name
}