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

Commit afab3c8

Browse files
authored
PowerShell 6 Core Support (#35)
## About This pull request reflects all changes done in the `linuxsupport` branch. ## Content - Enable PowerShell 6 Core support - Use PFX Certificate for encryption ( fixes #32 ) - Updates CI / CD pipeline ( fixes #31 ) - uses portable libressl ( fixes #34 ) - adds `-PassThru` switch for returning current `VIServer` session in `Connect-To` ( fixes #34 ) - adds git lfs for embedded libressl files - restructured internal functions into `Private` dir - added certificate related functions - adds travis build pipeline for tests
1 parent ab13962 commit afab3c8

83 files changed

Lines changed: 2445 additions & 1322 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/Vendor/libressl255/* filter=lfs diff=lfs merge=lfs -text
2+
*.pfx filter=lfs diff=lfs merge=lfs -text

.travis.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
language: csharp
3+
dotnet: 2.2.101
4+
mono: none
5+
6+
git:
7+
depth: 1000
8+
9+
os:
10+
- linux
11+
# Disable OSX bulds for now
12+
# - osx
13+
14+
sudo: required
15+
16+
dist: xenial
17+
osx_image: xcode8.1
18+
19+
matrix:
20+
fast_finish: true
21+
22+
23+
addons:
24+
artifacts:
25+
#paths: $(ls ./../dist/PowerShellGet.zip | tr "\n" ":")
26+
paths: ./dist/PowerShellGet.zip
27+
28+
29+
install:
30+
# Default 2.0.0 Ruby is buggy
31+
# Default bundler version is buggy
32+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
33+
rvm install ruby-2.3.3;
34+
rvm --default use 2.3.3;
35+
fi
36+
- bash <(wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh)
37+
- pushd tools
38+
- chmod +x travis.sh
39+
- popd
40+
41+
script:
42+
- echo "TRAVIS_EVENT_TYPE value $TRAVIS_EVENT_TYPE"
43+
- ./tools/travis.sh

.vscode/launch.json

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
{
2-
// Use IntelliSense to learn about possible attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5-
"version": "0.2.0",
6-
"configurations": [
7-
{
8-
"type": "PowerShell",
9-
"request": "launch",
10-
"name": "PowerShell Launch Current File",
11-
"script": "${file}",
12-
"args": [],
13-
"cwd": "${file}"
14-
},
15-
{
16-
"type": "PowerShell",
17-
"request": "launch",
18-
"name": "PowerShell Launch Current File in Temporary Console",
19-
"script": "${file}",
20-
"args": [],
21-
"cwd": "${file}",
22-
"createTemporaryIntegratedConsole": true
23-
},
24-
{
25-
"type": "PowerShell",
26-
"request": "launch",
27-
"name": "PowerShell Launch Current File w/Args Prompt",
28-
"script": "${file}",
29-
"args": [
30-
"${command:SpecifyScriptArgs}"
31-
],
32-
"cwd": "${file}"
33-
},
34-
{
35-
"type": "PowerShell",
36-
"request": "attach",
37-
"name": "PowerShell Attach to Host Process",
38-
"processId": "${command:PickPSHostProcess}",
39-
"runspaceId": 1
40-
},
41-
{
42-
"type": "PowerShell",
43-
"request": "launch",
44-
"name": "PowerShell Interactive Session",
45-
"cwd": "${workspaceRoot}"
46-
}
47-
]
48-
}
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "PowerShell",
9+
"request": "launch",
10+
"name": "PowerShell Launch Current File",
11+
"script": "${file}",
12+
"args": [],
13+
"cwd": "${file}"
14+
},
15+
{
16+
"type": "PowerShell",
17+
"request": "launch",
18+
"name": "PowerShell Launch Current File in Temporary Console",
19+
"script": "${file}",
20+
"args": [],
21+
"cwd": "${file}",
22+
"createTemporaryIntegratedConsole": true
23+
},
24+
{
25+
"type": "PowerShell",
26+
"request": "launch",
27+
"name": "PowerShell Launch Current File w/Args Prompt",
28+
"script": "${file}",
29+
"args": [
30+
"${command:SpecifyScriptArgs}"
31+
],
32+
"cwd": "${file}"
33+
},
34+
{
35+
"type": "PowerShell",
36+
"request": "attach",
37+
"name": "PowerShell Attach to Host Process",
38+
"processId": "${command:PickPSHostProcess}",
39+
"runspaceId": 1
40+
},
41+
{
42+
"type": "PowerShell",
43+
"request": "launch",
44+
"name": "PowerShell Interactive Session",
45+
"cwd": ""
46+
}
47+
]
48+
}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"powershell.codeFormatting.whitespaceAroundOperator": true,
2727
"powershell.codeFormatting.whitespaceAfterSeparator": true,
2828
"powershell.codeFormatting.ignoreOneLineBlock": true,
29-
"powershell.codeFormatting.alignPropertyValuePairs": false,
29+
"powershell.codeFormatting.alignPropertyValuePairs": true,
30+
"powershell.codeFormatting.preset": "Custom",
3031
// cspell spellchecker options
3132
"cSpell.enabledLanguageIds": [
3233
"c",

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,28 @@ need to store credentials for non interactive usage like in scheduled tasks.
2323
For more details read the [about_PSCredentialStore](/docs/about_PSCredentialStore.md) page on github or via CLI with
2424
`Get-Help about_PSCredentialStore`.
2525

26+
:exclamation: Upcoming Changes :exclamation:
27+
================
28+
29+
The will be some breaking changes starting with the `0.5.0.xxx`:
30+
31+
- **PSCredentialStore will use PFX certificates to encrypt your credentials.**
32+
- This replaces the the current encryption methods and you need to recreate or upgrade your pre existing stores.
33+
- The changes allows the PSCredentialStore module to support the PowerShell `Core` editions.
34+
- Yes this means, you can use the module on any PowerShell 6 supported linux distribution.
35+
- It's also possible to create a shared credential store and transfer it onto a another platform like:
36+
`Windows -- to --> Linux` and vice versa.
37+
- Automatically creates self signed certificate with 2048 bits RSA keys for encryption.
38+
2639
Installation
2740
============
2841

2942
PowerShellGallery.com (Recommended Way)
3043
---------------------------------------
3144

32-
* Make sure you use PowerShell 4.0 or higher with `$PSVersionTable`.
33-
* Use the builtin PackageManagement and install with: `Install-Module PSCredentialStore`
45+
* Make sure you use PowerShell 5.1 or higher with `$PSVersionTable`.
46+
* Use the builtin PackageManagement and install with: `Import-Module PowerShellGet; Install-Module 'PSCredentialStore' -Repository 'PSGallery'`
47+
* Additionally use the `-AllowPrerelease` switch until we publish the final release!
3448
* Done. Start exploring the Module with `Import-Module PSCredentialStore ; Get-Command -Module PSCredentialStore`
3549

3650
Manual Way
@@ -97,3 +111,13 @@ Connect-To -RemoteHost "fas.myside.local" -Type NetAppFAS
97111
Connect-To -RemoteHost "esx01.myside.local" -Type VMware
98112
Connect-To -RemoteHost "vcr.myside.local" -Type CisServer
99113
```
114+
115+
Credits
116+
-------
117+
118+
A huge thanks to all the people who helped with their projects and indirect contributions which made this possible!
119+
120+
- This module is inspired by the awesome work of @dlwyatt with articles like these:
121+
- https://powershell.org/2013/11/24/saving-passwords-and-preventing-other-processes-from-decrypting-them/
122+
- https://powershell.org/2014/02/01/revisited-powershell-and-encryption/
123+
- The awesome people from [LibreSSL](http://www.libressl.org/) which publishes the [portable openssl/libressl binaries](https://github.com/libressl-portable/portable)!

appveyor.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.2.3.{build}
1+
version: 0.5.0.{build}
22

33
#branches:
44
# only:
@@ -20,6 +20,7 @@ image: Visual Studio 2017
2020

2121
install:
2222
- ps: Import-Module .\tools\AppVeyor.psm1
23+
- ps: Import-Module .\tools\CoverallsIO.psm1
2324
- ps: Invoke-InstallDependencies
2425

2526
environment:
@@ -37,10 +38,10 @@ build_script:
3738
- ps: Invoke-AppVeyorBuild
3839

3940
test_script:
40-
- ps: Invoke-AppVeyorTests
4141
- ps: |
42+
$CodeCoverage = Invoke-AppVeyorTests
4243
if ($null -ne $Env:CoverallsToken) {
43-
Invoke-CoverageReport
44+
Invoke-CoverageReport -PesterCoverageReport $CodeCoverage
4445
}
4546
else {
4647
Write-Warning "No CoverallsToken found. This build seems to be triggered by a PR. Skipping this step..."
@@ -60,7 +61,7 @@ deploy:
6061
secure: M+bBX5/nKdJB0eViP7xtrLVTwf3vGDUA9N2MMprZp2i+9ZR3CBVcJnSzJWUmalhB
6162
artifact: PSCredentialStore.zip # upload all NuGet packages to release assets
6263
draft: false
63-
prerelease: false
64+
prerelease: true
6465
on:
6566
branch: master # build release on master branch changes
6667

assets/logo256.png

9.74 KB
Loading

docs/Get-CredentialStore.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Type: SwitchParameter
6363
Parameter Sets: Shared
6464
Aliases:
6565

66-
Required: False
66+
Required: True
6767
Position: Named
6868
Default value: False
6969
Accept pipeline input: False

docs/Get-CredentialStoreItem.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Get-CredentialStoreItem -RemoteHost <String> [-Identifier <String>] [<CommonPara
1919

2020
### Shared
2121
```
22-
Get-CredentialStoreItem [-Path <String>] -RemoteHost <String> [-Identifier <String>] [-Shared]
22+
Get-CredentialStoreItem -RemoteHost <String> [-Identifier <String>] [-Shared] [-Path <String>]
2323
[<CommonParameters>]
2424
```
2525

@@ -93,7 +93,7 @@ Type: SwitchParameter
9393
Parameter Sets: Shared
9494
Aliases:
9595

96-
Required: False
96+
Required: True
9797
Position: Named
9898
Default value: False
9999
Accept pipeline input: False

docs/New-CredentialStore.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Get-CredentialStoreItem -RemoteHost <String> [-Identifier <String>] [<CommonPara
1919

2020
### Shared
2121
```
22-
Get-CredentialStoreItem [-Path <String>] -RemoteHost <String> [-Identifier <String>] [-Shared]
22+
Get-CredentialStoreItem -RemoteHost <String> [-Identifier <String>] [-Shared] [-Path <String>]
2323
[<CommonParameters>]
2424
```
2525

@@ -93,7 +93,7 @@ Type: SwitchParameter
9393
Parameter Sets: Shared
9494
Aliases:
9595

96-
Required: False
96+
Required: True
9797
Position: Named
9898
Default value: False
9999
Accept pipeline input: False

0 commit comments

Comments
 (0)