Skip to content
This repository was archived by the owner on Jul 6, 2022. It is now read-only.

Commit 2422afb

Browse files
authored
Publish version 0.2.1.X (#18)
- fix pester test execution order in vscode test task. - fix coveralls.io link in bagde. - skip coverage report creation for PR triggered builds - update docs - Connection type SCP added for `Connect-To` and `Disconnect-From`. ## Internal Changes - pester tests now don't need to dotsource other public functions from the same module (fixes #17 ) - helper and private functions stilll needs to be dotsourced. - basic module tests added - pester tests for `Resolve-Dependency` added - Wrapper function `Get-ModuleBase` added. This enables mocking in tests.
1 parent 6912559 commit 2422afb

30 files changed

+614
-301
lines changed

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"taskName": "Test",
2929
"suppressTaskName": true,
3030
"args": [
31-
"Write-Host 'Invoking Pester...'; $ProgressPreference = 'SilentlyContinue'; Invoke-Pester -Script '.\\tests\\*' -EnableExit $flase -PesterOption @{IncludeVSCodeMarker=$true};",
31+
"Write-Host 'Invoking Pester...'; $ProgressPreference = 'SilentlyContinue'; Invoke-Pester -Script ( Get-ChildItem -Path '.\\tests\\*.Tests.ps1' -Recurse | Sort-Object -Property Name ) -EnableExit $flase -PesterOption @{IncludeVSCodeMarker=$true};",
3232
"Invoke-Command { Write-Host 'Completed Test task in task runner.' }"
3333
],
3434
"problemMatcher": "$pester",

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![AppVeyor branch](https://img.shields.io/appveyor/ci/OCram85/PSCredentialStore/master.svg?style=plastic "Master Banch Build Status")](https://ci.appveyor.com/project/OCram85/pscredentialstore/branch/master)
22
[![AppVeyor tests branch](https://img.shields.io/appveyor/tests/OCram85/PSCredentialStore/master.svg?style=plastic "Pester Tests Results")](https://ci.appveyor.com/project/OCram85/pscredentialstore/branch/master/tests)
3-
[![Coveralls github](https://img.shields.io/coveralls/github/OCram85/PSCredentialStore.svg?style=plastic "Coveralls.io Coverage Report")](https://coveralls.io/github/OCram85/PSCredentialStorebranch=master)
3+
[![Coveralls github](https://img.shields.io/coveralls/github/OCram85/PSCredentialStore.svg?style=plastic "Coveralls.io Coverage Report")](https://coveralls.io/github/OCram85/PSCredentialStore?branch=master)
44
[![PowerShell Gallery](https://img.shields.io/powershellgallery/v/PSCredentialStore.svg?style=plastic "PowershellGallery Published Version")](https://www.powershellgallery.com/packages/PSCredentialStore)
55
[![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/PSCredentialStore.svg?style=plastic "PowershellGallery Downloads")](https://www.powershellgallery.com/packages/PSCredentialStore)
66

@@ -20,7 +20,8 @@ scripts without exposing them as plain text.
2020
PSCredentialStore was developed to simplify the delegation of complex powershell scripts. In this case you often
2121
need to store credentials for non interactive usage like in scheduled tasks.
2222

23-
For more details read the [about_PSCredentialStore](/src/en-US/about_PSCredential.help.txt) page.
23+
For more details read the [about_PSCredentialStore](/docs/about_PSCredentialStore.md) page on github or via CLI with
24+
`Get-Help about_PSCredentialStore`.
2425

2526
Installation
2627
============
@@ -80,6 +81,12 @@ If you have already installed the underlying framework / modules, you can connec
8081
* Required Modules: [`VMware.VimAutomation.Core`](https://www.powershellgallery.com/packages/VMware.PowerCLI)
8182
* **CisServer** - Establish a connection to the CisServer Service on vCenter Host.
8283
* Required Modules: [`VMware.VimAutomation.Cis.Core`](https://www.powershellgallery.com/packages/VMware.PowerCLI)
84+
* **ExchangeHTTP** - Establish a remote connection with an Exchange endpoint via http.
85+
* Requires PowerShell remoting
86+
* **ExchangeHTTPS** - Establish a remote connection with an Exchange endpoint via https.
87+
* Requires PowerShell remoting
88+
* **SCP** - Establish a SCP connection.
89+
* Required Modules: [`WinSCP`](https://www.powershellgallery.com/packages/WinSCP)
8390

8491
Here are some basic examples:
8592

appveyor.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.2.0.{build}
1+
version: 0.2.1.{build}
22

33
branches:
44
only:
@@ -13,6 +13,11 @@ skip_tags: true
1313
image: Visual Studio 2017
1414

1515
# Install pester module and init the Appveyor support.
16+
17+
# Enable RDP connection for debugging
18+
#init:
19+
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
20+
1621
install:
1722
- ps: Import-Module .\tools\AppVeyor.psm1
1823
- ps: Invoke-InstallDependencies -Verbose
@@ -33,7 +38,13 @@ build_script:
3338

3439
test_script:
3540
- ps: Invoke-AppVeyorTests
36-
- ps: Invoke-CoverageReport
41+
- ps: |
42+
if ($null -ne $Env:CoverallsToken) {
43+
Invoke-CoverageReport
44+
}
45+
else {
46+
Write-Warning "No CoverallsToken found. This build seems to be triggered by a PR. Skipping this step..."
47+
}
3748
3849
deploy:
3950
#- provider: GitHub
@@ -55,3 +66,7 @@ deploy:
5566

5667
after_deploy:
5768
- ps: Invoke-AppVeyorPSGallery -OnBranch 'master'
69+
70+
# Pause build until `lock` on desktop is deleted.
71+
#on_finish:
72+
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

docs/Connect-To.md

Lines changed: 50 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -29,51 +29,56 @@ Establish a connection to the selected host using a stored CredentialStoreItem.
2929

3030
## EXAMPLES
3131

32-
### -------------------------- EXAMPLE 1 --------------------------
32+
### EXAMPLE 1
3333
```
3434
Connect-To -RemoteHost "ucs.myside.local" -Type CiscoUcs
3535
```
3636

37-
### -------------------------- EXAMPLE 2 --------------------------
37+
### EXAMPLE 2
3838
```
3939
Connect-To -RemoteHost "ftp.myside.local" -Type FTP
4040
```
4141

42-
### -------------------------- EXAMPLE 3 --------------------------
42+
### EXAMPLE 3
4343
```
4444
Connect-To -RemoteHost "fas.myside.local" -Type NetAppFAS
4545
```
4646

47-
### -------------------------- EXAMPLE 4 --------------------------
47+
### EXAMPLE 4
4848
```
4949
Connect-To -RemoteHost "esx01.myside.local" -Type VMware
5050
```
5151

52-
### -------------------------- EXAMPLE 5 --------------------------
52+
### EXAMPLE 5
5353
```
5454
Connect-To -RemoteHost "vCenter.myside.local" -Type CisServer
5555
```
5656

57-
### -------------------------- EXAMPLE 6 --------------------------
57+
### EXAMPLE 6
5858
```
59-
$MyCreds = Get-Credential
59+
Connect-To -RemoteHost "exchange01.myside.local" -Type ExchangeHTTP
6060
```
6161

62-
Connect-To -RemoteHost "vcr01.myside.local" -Type VMware -Credentials $MyCreds
63-
Get-VM -Name "*vlm*" | Select-Object -Property Name
64-
Disconnect-From -RemoteHost "vcr01.myside.local" -Type VMware
62+
### EXAMPLE 7
63+
```
64+
Connect-To -RemoteHost "exchange01.myside.local" -Type ExchangeHTTPS
65+
```
6566

6667
## PARAMETERS
6768

68-
### -RemoteHost
69-
Specify the host, for which you would like to change the credentials.
69+
### -Credentials
70+
Use this parameter to bypass the stored credentials.
71+
Without this parameter Connect-To tries to read the
72+
needed credentials from the CredentialStore.
73+
If you provide this parameter you skip this lookup behavior.
74+
So you can use it to enable credentials without preparing any user interaction.
7075

7176
```yaml
72-
Type: String
77+
Type: PSCredential
7378
Parameter Sets: (All)
74-
Aliases:
79+
Aliases:
7580

76-
Required: True
81+
Required: False
7782
Position: Named
7883
Default value: None
7984
Accept pipeline input: False
@@ -88,7 +93,7 @@ same hostname.
8893
```yaml
8994
Type: String
9095
Parameter Sets: (All)
91-
Aliases:
96+
Aliases:
9297

9398
Required: False
9499
Position: Named
@@ -97,80 +102,73 @@ Accept pipeline input: False
97102
Accept wildcard characters: False
98103
```
99104
100-
### -Type
101-
Specify the host type of the target.
102-
Currently implemented targets are:
103-
- CiscoUcs Establish a connection to a Cisco UCS fabric interconnect.
104-
- FTP Establish a connection to a FTP host.
105-
- NetAppFAS Establish a connection to a NetApp Clustered ONTAP filer.
106-
- VMware Establish a connection to a VMware vCenter or ESXi host.
107-
- CisServer Establish a connection to a Vmware CisServer.
105+
### -Path
106+
Define a custom path to a shared CredentialStore.
108107
109108
```yaml
110109
Type: String
111-
Parameter Sets: (All)
112-
Aliases:
110+
Parameter Sets: Shared
111+
Aliases:
113112

114-
Required: True
113+
Required: False
115114
Position: Named
116-
Default value: None
115+
Default value: "{0}\PSCredentialStore\CredentialStore.json" -f $env:ProgramData
117116
Accept pipeline input: False
118117
Accept wildcard characters: False
119118
```
120119
121-
### -Credentials
122-
Use this parameter to bypass the stored credentials.
123-
Without this parameter Connect-To tries to read the
124-
needed credentials from the CredentialStore.
125-
If you provide this parameter you skip this lookup behavior.
126-
So you can use it to enable credentials without preparing any user interaction.
120+
### -RemoteHost
121+
Specify the host, for which you would like to change the credentials.
127122
128123
```yaml
129-
Type: PSCredential
124+
Type: String
130125
Parameter Sets: (All)
131-
Aliases:
126+
Aliases:
132127

133-
Required: False
128+
Required: True
134129
Position: Named
135130
Default value: None
136131
Accept pipeline input: False
137132
Accept wildcard characters: False
138133
```
139134
140-
### -Path
141-
Define a custom path to a shared CredentialStore.
135+
### -Shared
136+
Switch to shared mode with this param.
137+
This enforces the command to work with a shared CredentialStore which
138+
can be decrypted across systems.
142139
143140
```yaml
144-
Type: String
141+
Type: SwitchParameter
145142
Parameter Sets: Shared
146-
Aliases:
143+
Aliases:
147144

148145
Required: False
149146
Position: Named
150-
Default value: "{0}\PSCredentialStore\CredentialStore.json" -f $env:ProgramData
147+
Default value: False
151148
Accept pipeline input: False
152149
Accept wildcard characters: False
153150
```
154151
155-
### -Shared
156-
Switch to shared mode with this param.
157-
This enforces the command to work with a shared CredentialStore which
158-
can be decrypted across systems.
152+
### -Type
153+
Specify the host type of the target.
154+
Currently implemented targets are: Possible connection values are:
155+
CiscoUcs, FTP, NetAppFAS, VMware, CisServer, ExchangeHTTP, ExchangeHTTPS, SCP.
159156
160157
```yaml
161-
Type: SwitchParameter
162-
Parameter Sets: Shared
163-
Aliases:
158+
Type: String
159+
Parameter Sets: (All)
160+
Aliases:
164161

165-
Required: False
162+
Required: True
166163
Position: Named
167-
Default value: False
164+
Default value: None
168165
Accept pipeline input: False
169166
Accept wildcard characters: False
170167
```
171168
172169
### CommonParameters
173-
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).
170+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
171+
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
174172
175173
## INPUTS
176174
@@ -181,11 +179,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
181179
### [None]
182180
183181
## NOTES
184-
\`\`\`
185182
File Name : Connect-To.ps1
186183
Author : Marco Blessing - marco.blessing@googlemail.com
187184
Requires :
188-
\`\`\`
189185
190186
## RELATED LINKS
191187

0 commit comments

Comments
 (0)