[TESTING] Coverage Report skipping for PRs #15
10
appveyor.yml
10
appveyor.yml
@ -1,4 +1,4 @@
|
|||||||
version: 0.2.0.{build}
|
version: 0.2.1.{build}
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
@ -33,7 +33,13 @@ build_script:
|
|||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- ps: Invoke-AppVeyorTests
|
- ps: Invoke-AppVeyorTests
|
||||||
- ps: Invoke-CoverageReport
|
- ps: |
|
||||||
|
if ($null -ne $Env:CoverallsToken) {
|
||||||
|
Invoke-CoverageReport
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Warning "No CoverallsToken found. This build seems to be triggered by a PR. Skipping this step..."
|
||||||
|
}
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
#- provider: GitHub
|
#- provider: GitHub
|
||||||
|
@ -29,32 +29,42 @@ Establish a connection to the selected host using a stored CredentialStoreItem.
|
|||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 1 --------------------------
|
### EXAMPLE 1
|
||||||
```
|
```
|
||||||
Connect-To -RemoteHost "ucs.myside.local" -Type CiscoUcs
|
Connect-To -RemoteHost "ucs.myside.local" -Type CiscoUcs
|
||||||
```
|
```
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 2 --------------------------
|
### EXAMPLE 2
|
||||||
```
|
```
|
||||||
Connect-To -RemoteHost "ftp.myside.local" -Type FTP
|
Connect-To -RemoteHost "ftp.myside.local" -Type FTP
|
||||||
```
|
```
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 3 --------------------------
|
### EXAMPLE 3
|
||||||
```
|
```
|
||||||
Connect-To -RemoteHost "fas.myside.local" -Type NetAppFAS
|
Connect-To -RemoteHost "fas.myside.local" -Type NetAppFAS
|
||||||
```
|
```
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 4 --------------------------
|
### EXAMPLE 4
|
||||||
```
|
```
|
||||||
Connect-To -RemoteHost "esx01.myside.local" -Type VMware
|
Connect-To -RemoteHost "esx01.myside.local" -Type VMware
|
||||||
```
|
```
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 5 --------------------------
|
### EXAMPLE 5
|
||||||
```
|
```
|
||||||
Connect-To -RemoteHost "vCenter.myside.local" -Type CisServer
|
Connect-To -RemoteHost "vCenter.myside.local" -Type CisServer
|
||||||
```
|
```
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 6 --------------------------
|
### EXAMPLE 6
|
||||||
|
```
|
||||||
|
Connect-To -RemoteHost "exchange01.myside.local" -Type ExchangeHTTP
|
||||||
|
```
|
||||||
|
|
||||||
|
### EXAMPLE 7
|
||||||
|
```
|
||||||
|
Connect-To -RemoteHost "exchange01.myside.local" -Type ExchangeHTTPS
|
||||||
|
```
|
||||||
|
|
||||||
|
### EXAMPLE 8
|
||||||
```
|
```
|
||||||
$MyCreds = Get-Credential
|
$MyCreds = Get-Credential
|
||||||
```
|
```
|
||||||
@ -105,6 +115,9 @@ Currently implemented targets are:
|
|||||||
- NetAppFAS Establish a connection to a NetApp Clustered ONTAP filer.
|
- NetAppFAS Establish a connection to a NetApp Clustered ONTAP filer.
|
||||||
- VMware Establish a connection to a VMware vCenter or ESXi host.
|
- VMware Establish a connection to a VMware vCenter or ESXi host.
|
||||||
- CisServer Establish a connection to a Vmware CisServer.
|
- CisServer Establish a connection to a Vmware CisServer.
|
||||||
|
- ExchangeHTTP Start a new remote session to the given Exchange server via insecure http.
|
||||||
|
- Exchange HTTPS Start a new remote session to the given exchange server with the secure https endpoint.
|
||||||
|
- SCP Establish a SCP connection.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
Type: String
|
Type: String
|
||||||
@ -181,11 +194,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
|
|||||||
### [None]
|
### [None]
|
||||||
|
|
||||||
## NOTES
|
## NOTES
|
||||||
\`\`\`
|
|
||||||
File Name : Connect-To.ps1
|
File Name : Connect-To.ps1
|
||||||
Author : Marco Blessing - marco.blessing@googlemail.com
|
Author : Marco Blessing - marco.blessing@googlemail.com
|
||||||
Requires :
|
Requires :
|
||||||
\`\`\`
|
|
||||||
|
|
||||||
## RELATED LINKS
|
## RELATED LINKS
|
||||||
|
|
||||||
|
@ -21,36 +21,46 @@ Terminates a session established with Connect-To using a CredentialStoreItem.
|
|||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 1 --------------------------
|
### EXAMPLE 1
|
||||||
```
|
```
|
||||||
Disconnect-From -RemoteHost "ucs.myside.local" -Type CiscoUcs
|
Disconnect-From -RemoteHost "ucs.myside.local" -Type CiscoUcs
|
||||||
```
|
```
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 2 --------------------------
|
### EXAMPLE 2
|
||||||
```
|
```
|
||||||
Disconnect-From -RemoteHost "ftp.myside.local" -Type FTP
|
Disconnect-From -RemoteHost "ftp.myside.local" -Type FTP
|
||||||
```
|
```
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 3 --------------------------
|
### EXAMPLE 3
|
||||||
```
|
```
|
||||||
Disconnect-From -RemoteHost "fas.myside.local" -Type NetAppFAS
|
Disconnect-From -RemoteHost "fas.myside.local" -Type NetAppFAS
|
||||||
```
|
```
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 4 --------------------------
|
### EXAMPLE 4
|
||||||
```
|
```
|
||||||
Disconnect-From -RemoteHost "esx01.myside.local" -Type VMware
|
Disconnect-From -RemoteHost "esx01.myside.local" -Type VMware
|
||||||
```
|
```
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 5 --------------------------
|
### EXAMPLE 5
|
||||||
```
|
```
|
||||||
Disconnect-From -RemoteHost "esx01.myside.local" -Type VMware -Force:$True
|
Disconnect-From -RemoteHost "esx01.myside.local" -Type VMware -Force:$True
|
||||||
```
|
```
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 6 --------------------------
|
### EXAMPLE 6
|
||||||
```
|
```
|
||||||
Disconnect-From -RemoteHost "vcenter.myside.local" -Type CisServer
|
Disconnect-From -RemoteHost "vcenter.myside.local" -Type CisServer
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### EXAMPLE 7
|
||||||
|
```
|
||||||
|
Disconnect-From -RemoteHost "exchange01.myside.local" -Type ExchangeHTTP
|
||||||
|
```
|
||||||
|
|
||||||
|
### EXAMPLE 8
|
||||||
|
```
|
||||||
|
Disconnect-From -RemoteHost "exchange01.myside.local" -Type ExchangeHTTPS
|
||||||
|
```
|
||||||
|
|
||||||
## PARAMETERS
|
## PARAMETERS
|
||||||
|
|
||||||
### -RemoteHost
|
### -RemoteHost
|
||||||
@ -76,6 +86,9 @@ Currently implemented targets are:
|
|||||||
- NetAppFAS Terminates the connection from a NetApp Clustered ONTAP filer.
|
- NetAppFAS Terminates the connection from a NetApp Clustered ONTAP filer.
|
||||||
- VMware Terminates the connection from a VMware vCenter or ESXi host.
|
- VMware Terminates the connection from a VMware vCenter or ESXi host.
|
||||||
- CisServer Terminates the connection from a Vmware CisServer.
|
- CisServer Terminates the connection from a Vmware CisServer.
|
||||||
|
- ExchangeHTTP Remove the existing remote session to the given Exchange server
|
||||||
|
- ExchangeHTTPS Remove the existing remote session to the given Exchange server
|
||||||
|
- SCP Terminates the existing SCP session.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
Type: String
|
Type: String
|
||||||
@ -116,11 +129,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
|
|||||||
### [None]
|
### [None]
|
||||||
|
|
||||||
## NOTES
|
## NOTES
|
||||||
\`\`\`
|
|
||||||
File Name : Disconnect-From.ps1
|
File Name : Disconnect-From.ps1
|
||||||
Author : Marco Blessing - marco.blessing@googlemail.com
|
Author : Marco Blessing - marco.blessing@googlemail.com
|
||||||
Requires :
|
Requires :
|
||||||
\`\`\`
|
|
||||||
|
|
||||||
## RELATED LINKS
|
## RELATED LINKS
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ Get-CredentialStoreItem.
|
|||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 1 --------------------------
|
### EXAMPLE 1
|
||||||
```
|
```
|
||||||
$CSContent = Get-CredentialStore -Path "C:\TMP\mystore.json"
|
$CSContent = Get-CredentialStore -Path "C:\TMP\mystore.json"
|
||||||
```
|
```
|
||||||
|
@ -28,7 +28,7 @@ Return the credential as PSCredential object.
|
|||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 1 --------------------------
|
### EXAMPLE 1
|
||||||
```
|
```
|
||||||
$myCreds = Get-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local"
|
$myCreds = Get-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local"
|
||||||
```
|
```
|
||||||
|
@ -28,7 +28,7 @@ Return the credential as PSCredential object.
|
|||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 1 --------------------------
|
### EXAMPLE 1
|
||||||
```
|
```
|
||||||
$myCreds = Get-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local"
|
$myCreds = Get-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local"
|
||||||
```
|
```
|
||||||
|
@ -33,7 +33,7 @@ a VIConnection, NetApp FAS or UCS Fabric Interconnect.
|
|||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 1 --------------------------
|
### EXAMPLE 1
|
||||||
```
|
```
|
||||||
New-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local"
|
New-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local"
|
||||||
```
|
```
|
||||||
|
@ -8,7 +8,7 @@ Locale: en-US
|
|||||||
|
|
||||||
# PSCredentialStore Module
|
# PSCredentialStore Module
|
||||||
## Description
|
## Description
|
||||||
PSCredentialStore enables managing multiple PSCredential objects.
|
{{Manually Enter Description Here}}
|
||||||
|
|
||||||
## PSCredentialStore Cmdlets
|
## PSCredentialStore Cmdlets
|
||||||
### [Connect-To](Connect-To.md)
|
### [Connect-To](Connect-To.md)
|
||||||
@ -41,3 +41,6 @@ Returns the credential store state.
|
|||||||
### [Test-CredentialStoreItem](Test-CredentialStoreItem.md)
|
### [Test-CredentialStoreItem](Test-CredentialStoreItem.md)
|
||||||
Checks if the given RemoteHost identifier combination exists in the credential store.
|
Checks if the given RemoteHost identifier combination exists in the credential store.
|
||||||
|
|
||||||
|
### [Test-CSConnection](Test-CSConnection.md)
|
||||||
|
Returns the connection state of a given type to the remote host.
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ Use this CMDLet to completely remove an credential store item.
|
|||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 1 --------------------------
|
### EXAMPLE 1
|
||||||
```
|
```
|
||||||
Remove-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local"
|
Remove-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local"
|
||||||
```
|
```
|
||||||
|
@ -28,7 +28,7 @@ Set-CredentialStoreItem [-Path <String>] -RemoteHost <String> [-Identifier <Stri
|
|||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 1 --------------------------
|
### EXAMPLE 1
|
||||||
```
|
```
|
||||||
Set-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local"
|
Set-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local"
|
||||||
```
|
```
|
||||||
|
82
docs/Test-CSConnection.md
Normal file
82
docs/Test-CSConnection.md
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
---
|
||||||
|
external help file: PSCredentialStore-help.xml
|
||||||
|
Module Name: PSCredentialStore
|
||||||
|
online version: https://github.com/OCram85/PSCredentialStore
|
||||||
|
schema: 2.0.0
|
||||||
|
---
|
||||||
|
|
||||||
|
# Test-CSConnection
|
||||||
|
|
||||||
|
## SYNOPSIS
|
||||||
|
Returns the connection state of a given type to the remote host.
|
||||||
|
|
||||||
|
## SYNTAX
|
||||||
|
|
||||||
|
```
|
||||||
|
Test-CSConnection [-RemoteHost] <String> [-Type] <String> [<CommonParameters>]
|
||||||
|
```
|
||||||
|
|
||||||
|
## DESCRIPTION
|
||||||
|
Use this script to check a connection which was established with the \`Connect-To\` cmdlet.
|
||||||
|
|
||||||
|
## EXAMPLES
|
||||||
|
|
||||||
|
### EXAMPLE 1
|
||||||
|
```
|
||||||
|
.\Test-CMConnection -RemoteHost "r0-i01-vcr01.p0r.kivbf-cloud.net" -Type VMware
|
||||||
|
```
|
||||||
|
|
||||||
|
## PARAMETERS
|
||||||
|
|
||||||
|
### -RemoteHost
|
||||||
|
Define the remote host you would like to check.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
Type: String
|
||||||
|
Parameter Sets: (All)
|
||||||
|
Aliases:
|
||||||
|
|
||||||
|
Required: True
|
||||||
|
Position: 1
|
||||||
|
Default value: None
|
||||||
|
Accept pipeline input: False
|
||||||
|
Accept wildcard characters: False
|
||||||
|
```
|
||||||
|
|
||||||
|
### -Type
|
||||||
|
Define the connection type you would like to check.
|
||||||
|
See the \`Connect-To\` documentation
|
||||||
|
for valid type values.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
Type: String
|
||||||
|
Parameter Sets: (All)
|
||||||
|
Aliases:
|
||||||
|
|
||||||
|
Required: True
|
||||||
|
Position: 2
|
||||||
|
Default value: None
|
||||||
|
Accept pipeline input: False
|
||||||
|
Accept wildcard characters: False
|
||||||
|
```
|
||||||
|
|
||||||
|
### CommonParameters
|
||||||
|
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||||
|
|
||||||
|
## INPUTS
|
||||||
|
|
||||||
|
### [None]
|
||||||
|
|
||||||
|
## OUTPUTS
|
||||||
|
|
||||||
|
### [Boolean]
|
||||||
|
|
||||||
|
## NOTES
|
||||||
|
File Name : Test-CSConnection.ps1
|
||||||
|
Author : Marco Blessing - marco.blessing@googlemail.com
|
||||||
|
Requires :
|
||||||
|
|
||||||
|
## RELATED LINKS
|
||||||
|
|
||||||
|
[https://github.com/OCram85/PSCredentialStore](https://github.com/OCram85/PSCredentialStore)
|
||||||
|
|
@ -30,7 +30,7 @@ the file exists.
|
|||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
### Example 1
|
### Example 1
|
||||||
```
|
```powershell
|
||||||
PS C:\> {{ Add example code here }}
|
PS C:\> {{ Add example code here }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ you try to interact with it.
|
|||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
### -------------------------- EXAMPLE 1 --------------------------
|
### EXAMPLE 1
|
||||||
```
|
```
|
||||||
If (Test-CredentialStoreItem -RemoteHost "Default") {
|
If (Test-CredentialStoreItem -RemoteHost "Default") {
|
||||||
```
|
```
|
||||||
|
@ -20,8 +20,9 @@ function Connect-To {
|
|||||||
- NetAppFAS Establish a connection to a NetApp Clustered ONTAP filer.
|
- NetAppFAS Establish a connection to a NetApp Clustered ONTAP filer.
|
||||||
- VMware Establish a connection to a VMware vCenter or ESXi host.
|
- VMware Establish a connection to a VMware vCenter or ESXi host.
|
||||||
- CisServer Establish a connection to a Vmware CisServer.
|
- CisServer Establish a connection to a Vmware CisServer.
|
||||||
- ExchangeHTTP Start a new remote session to the given Exchange server via unsecure http.
|
- ExchangeHTTP Start a new remote session to the given Exchange server via insecure http.
|
||||||
- Exchange HTTPS Start a new remote session to the given exchange server with the secure https endpoint.
|
- Exchange HTTPS Start a new remote session to the given exchange server with the secure https endpoint.
|
||||||
|
- SCP Establish a SCP connection.
|
||||||
|
|
||||||
.PARAMETER Credentials
|
.PARAMETER Credentials
|
||||||
Use this parameter to bypass the stored credentials. Without this parameter Connect-To tries to read the
|
Use this parameter to bypass the stored credentials. Without this parameter Connect-To tries to read the
|
||||||
@ -89,7 +90,16 @@ function Connect-To {
|
|||||||
|
|
||||||
[Parameter(Mandatory = $true, ParameterSetName = "Shared")]
|
[Parameter(Mandatory = $true, ParameterSetName = "Shared")]
|
||||||
[Parameter(Mandatory = $true, ParameterSetName = "Private")]
|
[Parameter(Mandatory = $true, ParameterSetName = "Private")]
|
||||||
[ValidateSet('CiscoUcs', 'FTP', 'NetAppFAS', 'VMware', 'CisServer', 'ExchangeHTTP', 'ExchangeHTTPS')]
|
[ValidateSet(
|
||||||
|
'CiscoUcs',
|
||||||
|
'FTP',
|
||||||
|
'NetAppFAS',
|
||||||
|
'VMware',
|
||||||
|
'CisServer',
|
||||||
|
'ExchangeHTTP',
|
||||||
|
'ExchangeHTTPS',
|
||||||
|
'SCP'
|
||||||
|
)]
|
||||||
[string]$Type,
|
[string]$Type,
|
||||||
|
|
||||||
[Parameter(Mandatory = $False, ParameterSetName = "Shared")]
|
[Parameter(Mandatory = $False, ParameterSetName = "Shared")]
|
||||||
@ -251,7 +261,6 @@ function Connect-To {
|
|||||||
ErrorAction = 'Stop'
|
ErrorAction = 'Stop'
|
||||||
}
|
}
|
||||||
$Global:PSExchangeRemote = New-PSSession @ConnectionParams
|
$Global:PSExchangeRemote = New-PSSession @ConnectionParams
|
||||||
$Global:PSExchangeRemote
|
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
# Write a error message to the log.
|
# Write a error message to the log.
|
||||||
@ -271,7 +280,6 @@ function Connect-To {
|
|||||||
ErrorAction = 'Stop'
|
ErrorAction = 'Stop'
|
||||||
}
|
}
|
||||||
$Global:PSExchangeRemote = New-PSSession @ConnectionParams
|
$Global:PSExchangeRemote = New-PSSession @ConnectionParams
|
||||||
$Global:PSExchangeRemote
|
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
# Write a error message to the log.
|
# Write a error message to the log.
|
||||||
@ -282,6 +290,36 @@ function Connect-To {
|
|||||||
Write-Error @MessageParams
|
Write-Error @MessageParams
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"SCP" {
|
||||||
|
$WinSCPSessionParams = @{
|
||||||
|
Credential = $creds
|
||||||
|
Hostname = $RemoteHost
|
||||||
|
Protocol = 'Scp'
|
||||||
|
GiveUpSecurityAndAcceptAnySshHostKey = $True
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
$SessionOption = New-WinSCPSessionOption @WinSCPSessionParams
|
||||||
|
$Global:WinSCPSession = New-WinSCPSession -SessionOption $SessionOption
|
||||||
|
Write-Verbose -Message ("SCP Connection established with {0}" -f $Global:WinSCPSession.Hostname)
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
# Write a error message to the log.
|
||||||
|
$MessageParams = @{
|
||||||
|
Message = "Unable to connect to {0} using Type {1}." -f $RemoteHost, $Type
|
||||||
|
ErrorAction = "Stop"
|
||||||
|
}
|
||||||
|
Write-Error @MessageParams
|
||||||
|
}
|
||||||
|
# Check the Connection State
|
||||||
|
if (!($WinSCPSession.Opened)) {
|
||||||
|
# Check the connection state and find out if the session is still open.
|
||||||
|
$MessageParams = @{
|
||||||
|
Message = "Connection to {0} using Type {1} was established. But now it seems to be lost!" -f $RemoteHost, $Type
|
||||||
|
ErrorAction = "Stop"
|
||||||
|
}
|
||||||
|
Write-Error @MessageParams
|
||||||
|
}
|
||||||
|
}
|
||||||
default {
|
default {
|
||||||
# Write a error message to the log.
|
# Write a error message to the log.
|
||||||
$MessageParams = @{
|
$MessageParams = @{
|
||||||
|
@ -22,6 +22,8 @@ function Disconnect-From {
|
|||||||
- CisServer Terminates the connection from a Vmware CisServer.
|
- CisServer Terminates the connection from a Vmware CisServer.
|
||||||
- ExchangeHTTP Remove the existing remote session to the given Exchange server
|
- ExchangeHTTP Remove the existing remote session to the given Exchange server
|
||||||
- ExchangeHTTPS Remove the existing remote session to the given Exchange server
|
- ExchangeHTTPS Remove the existing remote session to the given Exchange server
|
||||||
|
- SCP Terminates the existing SCP session.
|
||||||
|
|
||||||
.PARAMETER Force
|
.PARAMETER Force
|
||||||
Force the disconnect, even if the disconnect would fail.
|
Force the disconnect, even if the disconnect would fail.
|
||||||
|
|
||||||
@ -70,7 +72,16 @@ function Disconnect-From {
|
|||||||
[string]$RemoteHost,
|
[string]$RemoteHost,
|
||||||
|
|
||||||
[Parameter(Mandatory = $true)]
|
[Parameter(Mandatory = $true)]
|
||||||
[ValidateSet('CiscoUcs', 'FTP', 'NetAppFAS', 'VMware', 'CisServer', 'ExchangeHTTP', 'ExchangeHTTPS')]
|
[ValidateSet(
|
||||||
|
'CiscoUcs',
|
||||||
|
'FTP',
|
||||||
|
'NetAppFAS',
|
||||||
|
'VMware',
|
||||||
|
'CisServer',
|
||||||
|
'ExchangeHTTP',
|
||||||
|
'ExchangeHTTPS',
|
||||||
|
'SCP'
|
||||||
|
)]
|
||||||
[string]$Type,
|
[string]$Type,
|
||||||
|
|
||||||
[Parameter(Mandatory = $false)]
|
[Parameter(Mandatory = $false)]
|
||||||
@ -178,6 +189,18 @@ function Disconnect-From {
|
|||||||
Write-Error @MessageParams
|
Write-Error @MessageParams
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"SCP" {
|
||||||
|
if ($Global:WinSCPSession.Opened) {
|
||||||
|
Remove-WinSCPSession -WinSCPSession $Global:WinSCPSession
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$MessageParams = @{
|
||||||
|
Message = "There is no open WinSCP Session"
|
||||||
|
ErrorAction = "Stop"
|
||||||
|
}
|
||||||
|
Write-Error @MessageParams
|
||||||
|
}
|
||||||
|
}
|
||||||
default {
|
default {
|
||||||
# Write a error message to the log.
|
# Write a error message to the log.
|
||||||
$MessageParams = @{
|
$MessageParams = @{
|
||||||
|
@ -32,6 +32,12 @@
|
|||||||
"Modules": [
|
"Modules": [
|
||||||
"VMware.VimAutomation.Cis.Core"
|
"VMware.VimAutomation.Cis.Core"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "SCP",
|
||||||
|
"Modules": [
|
||||||
|
"WinSCP"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user