I am trying to use powershell to create a script which I use to add vpn connections to windows 8.1 machines. For this microsoft has made the add-vpnconnection cmdlet.
When running add-vpnconnection by hand, and supplying the mandatory parameters the cmdlet works fine.
When using my script to run the cmdlet - I am requested every single optional parameter before it functions. Does anyone know why? How can I prevent this?
Param( [Parameter(Mandatory=$true)] [string]$Client, [string]$Remotedns, [string]$DNSSUFFIX , [string]$TunnelType = "SSTP" ) #end param Add-VpnConnection -Name "$client VPN" -ServerAddress $Remotedns -AuthenticationMethod MSChapv2 -DnsSuffix $DNSSUFFIX = "" -SplitTunneling -TunnelType $TunnelType -AllUserConnection