Skip to content

Commit

Permalink
Merge branch 'release/0.1.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
gildas committed Aug 7, 2020
2 parents a3e6031 + fc34efa commit f2ce34f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
19 changes: 16 additions & 3 deletions Connect-VPN.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ function Connect-AnyConnect() # {{{
[Alias("Username")]
[string] $User,
[Parameter(Position=3, ParameterSetName='Plain', Mandatory=$true)]
[string] $Password
[string] $Password,
[Parameter(Position=4, Mandatory=$false)]
[switch] $AcceptNotice
)
if ($PSCmdlet.ParameterSetName -eq 'Credential')
{
Expand Down Expand Up @@ -72,14 +74,20 @@ function Connect-AnyConnect() # {{{
Start-Sleep 2

Write-Verbose "Sending connect"
$vpncli.StandardInput.WriteLine('connect ' + $ComputerName)
$vpncli.StandardInput.WriteLine('connect ' + """$ComputerName""")

Write-Verbose "Sending user"
$vpncli.StandardInput.WriteLine($User)

Write-Verbose "Sending password"
$vpncli.StandardInput.WriteLine($Password)

If ( $AcceptNotice )
{
Write-Verbose "Accepting notice"
$vpncli.StandardInput.WriteLine("y")
}

Write-Verbose "Reading its output stream"
$found = $false
for ($output = $vpncli.StandardOutput.ReadLine(); $output -ne $null; $output = $vpncli.StandardOutput.ReadLine())
Expand Down Expand Up @@ -139,6 +147,9 @@ function Connect-AnyConnect() # {{{
.PARAMETER Password
If no PSCredential is provided, a User and a (plain text) Password must be provided.
.PARAMETER AcceptNotice
Accept notice from the server, like a banner message.
.INPUTS
The ComputerName can be piped in.
Expand Down Expand Up @@ -180,7 +191,9 @@ function Connect-VPN # {{{
[Alias("Username")]
[string] $User,
[Parameter(Position=4, ParameterSetName='Plain', Mandatory=$true)]
[string] $Password
[string] $Password,
[Parameter(Position=5, Mandatory=$false)]
[switch] $AcceptNotice
)
DynamicParam
{
Expand Down
2 changes: 1 addition & 1 deletion Install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Param(
)

$ModuleName = 'Posh-VPN'
$ModuleVersion = '0.1.4'
$ModuleVersion = '0.1.5'
$GithubRoot = "https://raw.githubusercontent.com/gildas/posh-vpn/$ModuleVersion"

if ([string]::IsNullOrEmpty($Path))
Expand Down
2 changes: 1 addition & 1 deletion Posh-VPN.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'Posh-VPN.psm1'

# Version number of this module.
ModuleVersion = '0.1.4'
ModuleVersion = '0.1.5'

# ID used to uniquely identify this module
GUID = 'c762b59e-61f1-4411-9c5b-3709a00199c1'
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Install-Module Posh-VPN
Copy the following line and paste it in a Powershell:

```posh
Start-BitsTransfer http://tinyurl.com/posh-vpn-0-1-4 $env:TEMP ; & $env:TEMP\Install.ps1
Start-BitsTransfer http://tinyurl.com/posh-vpn-0-1-5 $env:TEMP ; & $env:TEMP\Install.ps1
```

To install the latest development version, use one of the followings:
Expand All @@ -33,6 +33,13 @@ The following options are accepted:
When this parameter is not present, the module will be installed in WindowsPowerShell\Modules\Posh-VPN under the user's documents.
In general, you will not need this parameter as the default folder gets automatically added in the list of folders where Powershell searches for modules and loads them.
Default: None
- -Credential
Contains a `PSCredential` to log in the VPN.
- -User, -Password
Contain the user and the password to log in the VPN.
This is less secure than `-Credential` as you need to use plain text.
- -AcceptNotice
Accept notice (*banner*) from the VPN server.
- -Verbose
Acts verbosely
- -WhatIf
Expand Down Expand Up @@ -80,3 +87,8 @@ vpn.acme.com
AUTHORS
=======
[![endorse](https://api.coderwall.com/gildas/endorsecount.png)](https://coderwall.com/gildas)

CONTRIBUTORS
============
- [Charl Meyers](https://github.com/charlmeyers-bee123)
- [Morgan Simonsen](https://github.com/morgansimonsen)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.4
0.1.5

0 comments on commit f2ce34f

Please sign in to comment.