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

Commit 64af16c

Browse files
authored
Publish Pre-release (#1)
* adds basic module layout * fix module manifest encoding * fix callsign in appveyor helper * adds challenge file related functions * adds connection manager functions * adds Test-ChallengeFile * adds item related functions * adds store related functions * adds cSpell dictionary * adds CredentialStore related Pester tests * [WIP] test Pester file * fix typo * adds file dependencies * [WIP] fix pester tests * fix exception state * [WIP] add file dependencies * fix gitkeep filename * set constant debug module version string * adds Pester Tests for New-CredentialStoreItem * adds basic readme file * adds functions to export; adds meta data * adds vscode debug config * adds test for optional dependencies * [WIP] Implements optional dependency test * adds taskrunner definitions * adds CBH * add gitignore file * adds basic Build tasks * typo fixed * adds build folder to ignore list * adds Cisco and NetApp opt dependencies * adds build task * fix end of line dequence * remove task.json error * adds sources for optional modules * enables Pester and posh-git * prepare pre-release
1 parent 5ebba20 commit 64af16c

37 files changed

+2503
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Don't local track test builds
2+
bin/PSCredentialStore.zip
3+
bin/PSCredentialStore/*

.vscode/cSpell.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// cSpell Settings
2+
{
3+
// Version of the setting file. Always 0.1
4+
"version": "0.1",
5+
// language - current active spelling language
6+
"language": "en",
7+
// words - list of words to be always considered correct
8+
"words": [
9+
"Cmdlet",
10+
"Cmdlets",
11+
"GUID",
12+
"Hashtable",
13+
"Httpclient",
14+
"Multipart",
15+
"NTFS",
16+
"Params",
17+
"Ponduit",
18+
"Repo",
19+
"Veyor",
20+
"appveyor",
21+
"callsign",
22+
"choco",
23+
"chocolatey",
24+
"codecoverage",
25+
"creds",
26+
"formdata",
27+
"googlemail",
28+
"notlike",
29+
"notmatch",
30+
"powershellgallery",
31+
"testresults",
32+
"wildcards"
33+
],
34+
// flagWords - list of words to be always considered incorrect
35+
// This is useful for offensive words and common spelling errors.
36+
// For example "hte" should be "the"
37+
"flagWords": [
38+
"hte"
39+
]
40+
}

.vscode/launch.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +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+
}

.vscode/settings.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
// Set basic file related options:
4+
"files.encoding": "utf8",
5+
"files.eol": "\r\n",
6+
"files.trimTrailingWhitespace": true,
7+
"files.insertFinalNewline": true,
8+
// Formation and editor options
9+
"editor.renderWhitespace": "boundary",
10+
"editor.formatOnSave": true,
11+
"editor.formatOnType": true,
12+
"editor.rulers": [
13+
116
14+
],
15+
// powershell general
16+
"powershell.startAutomatically": true,
17+
"powershell.useX86Host": false,
18+
"powershell.enableProfileLoading": true,
19+
"powershell.scriptAnalysis.enable": true,
20+
// powershell code Formatting
21+
"powershell.codeFormatting.openBraceOnSameLine": true,
22+
"powershell.codeFormatting.newLineAfterOpenBrace": true,
23+
"powershell.codeFormatting.newLineAfterCloseBrace": true,
24+
"powershell.codeFormatting.whitespaceBeforeOpenBrace": true,
25+
"powershell.codeFormatting.whitespaceBeforeOpenParen": true,
26+
"powershell.codeFormatting.whitespaceAroundOperator": true,
27+
"powershell.codeFormatting.whitespaceAfterSeparator": true,
28+
"powershell.codeFormatting.ignoreOneLineBlock": true,
29+
"powershell.codeFormatting.alignPropertyValuePairs": false,
30+
// cspell spellchecker options
31+
"cSpell.enabledLanguageIds": [
32+
"c",
33+
"cpp",
34+
"csharp",
35+
"go",
36+
"javascript",
37+
"javascriptreact",
38+
"json",
39+
"latex",
40+
"markdown",
41+
"php",
42+
"plaintext",
43+
"powershell",
44+
"python",
45+
"text",
46+
"typescript",
47+
"typescriptreact",
48+
"yml"
49+
]
50+
}

.vscode/tasks.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
// Start PowerShell
6+
"windows": {
7+
"command": "${env:windir}/System32/WindowsPowerShell/v1.0/powershell.exe",
8+
"args": [
9+
"-NoProfile",
10+
"-ExecutionPolicy",
11+
"Bypass"
12+
]
13+
},
14+
"linux": {
15+
"command": "/usr/bin/powershell",
16+
"args": [
17+
"-NoProfile"
18+
]
19+
},
20+
"osx": {
21+
"command": "/usr/local/bin/powershell",
22+
"args": [
23+
"-NoProfile"
24+
]
25+
},
26+
"tasks": [
27+
{
28+
"taskName": "Test",
29+
"suppressTaskName": true,
30+
"args": [
31+
"Write-Host 'Invoking Pester...'; $ProgressPreference = 'SilentlyContinue'; Invoke-Pester -Script '.\\tests\\*' -EnableExit $flase -PesterOption @{IncludeVSCodeMarker=$true};",
32+
"Invoke-Command { Write-Host 'Completed Test task in task runner.' }"
33+
],
34+
"problemMatcher": "$pester",
35+
"group": {
36+
"kind": "test",
37+
"isDefault": true
38+
}
39+
},
40+
{
41+
"taskName": "DebugBuild",
42+
"suppressTaskName": true,
43+
"args": [
44+
"Write-Host 'Invoking Build...';",
45+
"Write-Host -Object 'Test previous builds.' -ForegroundColor Blue;",
46+
"If (Test-Path -Path '.\\bin\\PSCredentialStore.zip') { Remove-Item -Path '.\\bin\\PSCredentialStore.zip' -Verbose};",
47+
"Copy-Item -Path '.\\src\\' -Destination '.\\bin\\PSCredentialStore' -Recurse -Verbose -Force;",
48+
"Compress-Archive -Path '.\\src\\*' -DestinationPath '.\\bin\\PSCredentialStore.zip' -Update -Verbose;"
49+
],
50+
"group": {
51+
"kind": "build",
52+
"isDefault": true
53+
}
54+
}
55+
]
56+
}

README.md

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,84 @@
1-
# PSCredentialStore
1+
| AppVeyor Overall | AppVeyor Master | AppVeyor Dev | Coveralls.io | Download |
2+
| :--------------: | :-------------: | :----------: | :-----------: | :--------:|
3+
| [![Build status](https://ci.appveyor.com/api/projects/status/b4t8x88xai3ee7gk?svg=true)](https://ci.appveyor.com/project/OCram85/PSCredentialStore) | [![Build status](https://ci.appveyor.com/api/projects/status/b4t8x88xai3ee7gk/branch/master?svg=true)](https://ci.appveyor.com/project/OCram85/PSCredentialStore/branch/master) | [![Build status](https://ci.appveyor.com/api/projects/status/b4t8x88xai3ee7gk/branch/dev?svg=true)](https://ci.appveyor.com/project/OCram85/PSCredentialStore/branch/dev) | [![Coverage Status](https://coveralls.io/repos/github/OCram85/PSCredentialStore/badge.svg?branch=master)](https://coveralls.io/github/OCram85/PSCredentialStore?branch=master) | [![Download](https://img.shields.io/badge/powershellgallery-PSCredentialStore-blue.svg)](https://www.powershellgallery.com/packages/PSCredentialStore)
4+
5+
General
6+
=======
7+
8+
The PSCredentialStore is an simple credential manager for PSCredentials. It stores multiple credential objects in a
9+
simple json file. You can choose between a private and shared store. The private one exists in your profile and can
10+
ony accessed by your account on the same machine. The shared store enables you to use different credentials for your
11+
script without exposing them as plain text.
12+
13+
**The shared store isn't 100% secure and I don't recommend using it in production!**
14+
15+
PSCredentialStore was developed to simplify the delegation of complex powershell scripts. In this case you often
16+
need to store credentials for non interactive usage like in scheduled tasks.
17+
18+
To get started read the [about_PSCredentialStore](/src/en-US/about_PSCredential.help.txt) page.
19+
20+
Installation
21+
============
22+
23+
PowerShellGallery.com (Recommended Way)
24+
---------------------------------------
25+
26+
* Make sure you use PowerShell 4.0 or higher with `$PSVersionTable`.
27+
* Use the builtin PackageManagement and install with: `Install-Module PSCredentialStore`
28+
* Done. Start exploring the Module with `Import-Module PSCredentialStore ; Get-Command -Module PSCredentialStore`
29+
30+
Manual Way
31+
----------
32+
33+
* Take a look at the [Latest Release](https://github.com/OCram85/PSCredentialStore/releases/latest) page.
34+
* Download the `PSCredentialStore.zip`.
35+
* Unpack the Zip and put it in your Powershell Module path.
36+
* Don't forget to change the NTFS permission flag in the context menu.
37+
* Start with `Import-Module PSCredentialStore`
38+
39+
Quick Start
40+
-----------
41+
42+
**1.** First we need a blank CredentialStore. You can decide between a *private* or *shared* store. The private
43+
Credential Store can only be accessed with your profile on the machine you created it.
44+
```powershell
45+
# Private Credential Store
46+
New-CredentialStore
47+
48+
# Shared Credential Store
49+
New-CredentialStore -Shared
50+
51+
#Shared CredentialStore in custom Location
52+
New-CredentialStore -Shared -Path 'C:\CredentialStore.json'
53+
```
54+
55+
**2.** Now you can manage your CredentialStoreItems:
56+
```powershell
57+
# This will prompt for credentials and stores it in a private store
58+
New-CredentialStoreItem -RemoteHost 'dc01.myside.local' -Identifier 'AD'
59+
60+
# You can now use it in other scripts like this:
61+
$DCCreds = Get-CredentialStoreItem -RemoteHost 'dc01.myside.local' -Identifier 'AD'
62+
Invoke-Command -ComputerName 'dc01.myside.local' -Credential $DCCreds -ScripBlock {Get-Process}
63+
```
64+
65+
The CredentialStore contains also a simple function to establish a connection with several systems or protocols.
66+
If you have already installed the underlying framework your can connect to:
67+
68+
* **CiscoUcs** - Establish a connection to a Cisco UCS fabric interconnect.
69+
* Required Modules: [`Cisco.UCS.Core`, `Cisco.UCSManager`](https://software.cisco.com/download/release.html?i=!y&mdfid=286305108&softwareid=284574017&release=2.1.1)
70+
* **FTP** - Establish a connection to a FTP host.
71+
* Required Modules: [`WinSCP`](https://www.powershellgallery.com/packages/WinSCP)
72+
* **NetAppFAS** - Establish a connection to a NetApp Clustered ONTAP filer.
73+
* Required Modules: [`DataONTAP`](http://mysupport.netapp.com/tools/info/ECMLP2310788I.html?productID=61926)
74+
* **VMware** - Establish a connection to a VMware vCenter or ESXi host.
75+
* Required Modules: [`VMware.VimAutomation.Core`](https://www.powershellgallery.com/packages/VMware.PowerCLI)
76+
77+
Here are some basic examples:
78+
79+
```powershell
80+
Connect-To -RemoteHost "ucs.myside.local" -Type CiscoUcs
81+
Connect-To -RemoteHost "ftp.myside.local" -Type FTP
82+
Connect-To -RemoteHost "fas.myside.local" -Type NetAppFAS
83+
Connect-To -RemoteHost "esx01.myside.local" -Type VMware
84+
```

appveyor.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
version: 0.1.{build}
2+
3+
branches:
4+
only:
5+
- master
6+
- dev
7+
- debug
8+
9+
skip_tags: true
10+
11+
#image: WMF 5
12+
# Test ne build image:
13+
image: Visual Studio 2017
14+
15+
# Install pester module and init the Appveyor support.
16+
install:
17+
- ps: Install-PackageProvider -Name NuGet -MinimumVersion '2.8.5.201' -Force -Verbose
18+
- ps: Import-PackageProvider NuGet -MinimumVersion '2.8.5.201' -Force
19+
- ps: Install-Module -Name 'Pester' -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber
20+
- ps: Update-Module 'Pester'
21+
- ps: Install-Module -Name 'posh-git' -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber
22+
- ps: Update-Module 'posh-git'
23+
- ps: Install-Module -Name 'PSCoverage' -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber
24+
- ps: Import-Module 'PSCoverage'
25+
- ps: Import-Module .\tools\AppVeyor.psm1
26+
27+
environment:
28+
NuGetToken:
29+
secure: 835qfZIkC9mE7QhkYfOZVAdR8rZhPvxG8BO4CbeaelRQOhlqmaSr8G1DWRJzZ/bS
30+
CoverallsToken:
31+
secure: eTjWqHL48MBr8wp1rSgLrXHdtpfDV/uClacP3svlWJfCvn/zVokpuaMnWM5RoyIY
32+
33+
build: false
34+
35+
before_build:
36+
- ps: Invoke-AppVeyorBumpVersion
37+
38+
build_script:
39+
- ps: Invoke-AppVeyorBuild
40+
41+
test_script:
42+
- ps: Invoke-AppVeyorTests
43+
- ps: Invoke-CoverageReport
44+
45+
deploy:
46+
- provider: GitHub
47+
auth_token:
48+
secure: M+bBX5/nKdJB0eViP7xtrLVTwf3vGDUA9N2MMprZp2i+9ZR3CBVcJnSzJWUmalhB
49+
artifact: PSCredentialStore.zip # upload all NuGet packages to release assets
50+
draft: true
51+
prerelease: true
52+
on:
53+
branch: master # release from master branch only
54+
55+
after_deploy:
56+
- ps: Invoke-AppVeyorPSGallery

bin/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a placeholder file. The build Server will create all bin files here.

resources/.gitkeep

Whitespace-only changes.

resources/cs/Broken_CS.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"Version": "1.2.0",
3+
"Creation": "2016-06-14 08:41:10"

0 commit comments

Comments
 (0)