I'm trying to install this module "VPNCredentialsHelper", but I get the following prompt even if I use the "-force" flag:
C:\Windows\system32>powershell -command "Install-Module -Name VPNCredentialsHelper -force"
NuGet-anycpu.exe is required to continue.
PowerShellGet requires NuGet-anycpu.exe to interact with NuGet based galleries. NuGet-anycpu.exe must be available in
'C:\Program Files\PackageManagement\ProviderAssemblies' or
'C:\Users\WmWare\AppData\Local\PackageManagement\ProviderAssemblies'. For more information about NuGet provider, see
http://OneGet.org/NuGet.html. Do you want PowerShellGet to download NuGet-anycpu.exe now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"):
I want to skip this prompt and accept forcefully the following lines:
- rasdial.exe Name_VPN /disconnect
- PowerShell.exe -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force"
- PowerShell.exe -Command "Set-PSRepository -Name 'VPNCredentialsHelper' -InstallationPolicy Trusted"
- PowerShell.exe -Command "Install-Module -Name VPNCredentialsHelper -Force"
- PowerShell.exe -Command "Add-VpnConnection -Name Name_VPN -ServerAddress " + servertxt.Text.Trim() + " -AllUserConnection -AuthenticationMethod MSChapv2 -EncryptionLevel Required -Force -L2tpPsk " + psktxt.Text.Trim() + " -PassThru -RememberCredential -TunnelType L2tp"
- PowerShell.exe -Command "Set-VpnConnectionUsernamePassword -connectionname Name_VPN -username " + usernametxt.Text.Trim() + " -password " + passwordtxt.Text.Trim() + " -DnsSuffix "192.168.0.0/24" //values added from UI
I have the following version:
C:\Windows\system32>powershell $PSVersionTable
Name Value
---- -----
PSVersion 5.0.10240.16384
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.42000
BuildVersion 10.0.10240.16384
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
-Force
has no meaning regarding module retrieval. Depending on the PowerShellGet version, it has no effect whatsoever.