From 21af7d02c3fa1fe2c1d11a591347bf417b8158a7 Mon Sep 17 00:00:00 2001 From: Marco Blessing Date: Fri, 20 Oct 2017 10:44:09 +0200 Subject: [PATCH 01/11] Implements ConnectionType CisServer (#9) * adds optinal dependency for CisServer * adds Connection Type CisServer * Adds connection type CisServer * prepare beta build on dev --- appveyor.yml | 20 ++++++++--------- src/Connection/Connect-To.ps1 | 28 ++++++++++++++++++++++-- src/Connection/Disconnect-From.ps1 | 35 ++++++++++++++++++++++++------ src/Dependency.json | 6 +++++ 4 files changed, 70 insertions(+), 19 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ea07ece..cc17a2a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,15 +42,15 @@ test_script: - ps: Invoke-AppVeyorTests - ps: Invoke-CoverageReport -#deploy: -# - provider: GitHub -# auth_token: -# secure: M+bBX5/nKdJB0eViP7xtrLVTwf3vGDUA9N2MMprZp2i+9ZR3CBVcJnSzJWUmalhB -# artifact: PSCredentialStore.zip # upload all NuGet packages to release assets -# draft: false -# prerelease: true -# on: -# branch: master # release from master branch only -# +deploy: + - provider: GitHub + auth_token: + secure: M+bBX5/nKdJB0eViP7xtrLVTwf3vGDUA9N2MMprZp2i+9ZR3CBVcJnSzJWUmalhB + artifact: PSCredentialStore.zip # upload all NuGet packages to release assets + draft: false + prerelease: true + on: + branch: dev # release from master branch only + #after_deploy: # - ps: Invoke-AppVeyorPSGallery diff --git a/src/Connection/Connect-To.ps1 b/src/Connection/Connect-To.ps1 index 740ee6a..7c172bf 100644 --- a/src/Connection/Connect-To.ps1 +++ b/src/Connection/Connect-To.ps1 @@ -19,6 +19,7 @@ function Connect-To { - FTP Establish a connection to a FTP host. - NetAppFAS Establish a connection to a NetApp Clustered ONTAP filer. - VMware Establish a connection to a VMware vCenter or ESXi host. + - CisServer Establish a connection to a Vmware CisServer. .PARAMETER Credentials Use this parameter to bypass the stored credentials. Without this parameter Connect-To tries to read the @@ -40,10 +41,19 @@ function Connect-To { .EXAMPLE Connect-To -RemoteHost "ucs.myside.local" -Type CiscoUcs + + .EXAMPLE Connect-To -RemoteHost "ftp.myside.local" -Type FTP + + .EXAMPLE Connect-To -RemoteHost "fas.myside.local" -Type NetAppFAS + + .EXAMPLE Connect-To -RemoteHost "esx01.myside.local" -Type VMware + .EXAMPLE + Connect-To -RemoteHost "vCenter.myside.local" -Type CisServer + .EXAMPLE $MyCreds = Get-Credential Connect-To -RemoteHost "vcr01.myside.local" -Type VMware -Credentials $MyCreds @@ -53,7 +63,7 @@ function Connect-To { .NOTES File Name : Connect-To.ps1 Author : Marco Blessing - marco.blessing@googlemail.com - Requires : PSFTP, PowerCLI + Requires : .LINK https://github.com/OCram85/PSCredentialStore @@ -70,7 +80,7 @@ function Connect-To { [Parameter(Mandatory = $true, ParameterSetName = "Shared")] [Parameter(Mandatory = $true, ParameterSetName = "Private")] - [ValidateSet("CiscoUcs", "FTP", "NetAppFAS", "VMware")] + [ValidateSet("CiscoUcs", "FTP", "NetAppFAS", "VMware", "CisServer")] [String]$Type, [Parameter(Mandatory = $False, ParameterSetName = "Shared")] @@ -199,6 +209,20 @@ function Connect-To { Write-Error @MessageParams } } + "CisServer" { + try { + Connect-CisServer -Server $RemoteHost -Credential $creds -ErrorAction Stop | Out-Null + } + + 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 + } + } default { # Write a error message to the log. $MessageParams = @{ diff --git a/src/Connection/Disconnect-From.ps1 b/src/Connection/Disconnect-From.ps1 index 8fa8c2b..4756768 100644 --- a/src/Connection/Disconnect-From.ps1 +++ b/src/Connection/Disconnect-From.ps1 @@ -15,11 +15,11 @@ function Disconnect-From { .PARAMETER Type Specify the host type of the target. Currently implemented targets are: - - CiscoUcs Establish a connection to a Cisco UCS Fabric Interconnect. - - FTP Establish a connection to a FTP host. - - NetAppFAS Establish a connection to a NetApp Clustered ONTAP filer. - - VMware Establish a connection to a VMware vCenter or ESXi host. - + - CiscoUcs Terminates the connection from a Cisco UCS Fabric Interconnect. + - FTP Terminates the connection from a FTP host. + - NetAppFAS Terminates the connection from a NetApp Clustered ONTAP filer. + - VMware Terminates the connection from a VMware vCenter or ESXi host. + - CisServer Terminates the connection from a Vmware CisServer. .PARAMETER Force Force the disconnect, even if the disconnect would fail. @@ -44,8 +44,11 @@ function Disconnect-From { .EXAMPLE Disconnect-From -RemoteHost "esx01.myside.local" -Type VMware -Force:$True + .EXAMPLE + Disconnect-From -RemoteHost "vcenter.myside.local" -Type CisServer + .NOTES - File Name : Disconnect-To.ps1 + File Name : Disconnect-From.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : @@ -59,7 +62,7 @@ function Disconnect-From { [string]$RemoteHost, [Parameter(Mandatory = $true)] - [ValidateSet("CiscoUcs", "FTP", "NetAppFAS", "VMware")] + [ValidateSet("CiscoUcs", "FTP", "NetAppFAS", "VMware", "CisServer")] [string]$Type, [Parameter(Mandatory = $false)] @@ -85,7 +88,25 @@ function Disconnect-From { } Write-Error @MessageParams } + } + "CisServer" { + try { + if ($Force) { + Disconnect-CisServer -Server $RemoteHost -Confirm:$false -ErrorAction Stop -Force:$true + } + else { + Disconnect-CisServer -Server $RemoteHost -Confirm:$false -ErrorAction Stop + } + } + catch { + # Write a error message to the log. + $MessageParams = @{ + Message = "Unable to disconnect from {0} using Type {1}." -f $RemoteHost, $Type + ErrorAction = "Stop" + } + Write-Error @MessageParams + } } # Check for an existing WinSCP Session var "FTP" { diff --git a/src/Dependency.json b/src/Dependency.json index d76a42f..865f246 100644 --- a/src/Dependency.json +++ b/src/Dependency.json @@ -26,6 +26,12 @@ "Modules": [ "DataONTAP" ] + }, + { + "Name": "CisServer", + "Modules": [ + "VMware.VimAutomation.Cis.Core" + ] } ] } -- 2.45.2 From b047d3ce06020dcf1861f0ef6ed2687e3ccaec09 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Fri, 20 Oct 2017 10:48:03 +0200 Subject: [PATCH 02/11] enable private build --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index cc17a2a..d900c21 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -47,7 +47,7 @@ deploy: auth_token: secure: M+bBX5/nKdJB0eViP7xtrLVTwf3vGDUA9N2MMprZp2i+9ZR3CBVcJnSzJWUmalhB artifact: PSCredentialStore.zip # upload all NuGet packages to release assets - draft: false + draft: true prerelease: true on: branch: dev # release from master branch only -- 2.45.2 From a1aa70f20be9b0e4d13f346f928bf9c0ed75be5f Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 23 Oct 2017 07:43:16 +0200 Subject: [PATCH 03/11] update docs --- README.md | 3 +++ docs/about_PSCredentialStore.md | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 20c3c7a..0f2472b 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,8 @@ If you have already installed the underlying framework / modules, you can connec * Required Modules: [`DataONTAP`](http://mysupport.netapp.com/tools/info/ECMLP2310788I.html?productID=61926) * **VMware** - Establish a connection to a VMware vCenter or ESXi host. * Required Modules: [`VMware.VimAutomation.Core`](https://www.powershellgallery.com/packages/VMware.PowerCLI) +* **CisServer** - Establish a connection to the CisServer Service on vCenter Host. + * Required Modules: [`VMware.VimAutomation.Cis.Core`](https://www.powershellgallery.com/packages/VMware.PowerCLI) Here are some basic examples: @@ -81,4 +83,5 @@ Connect-To -RemoteHost "ucs.myside.local" -Type CiscoUcs Connect-To -RemoteHost "ftp.myside.local" -Type FTP Connect-To -RemoteHost "fas.myside.local" -Type NetAppFAS Connect-To -RemoteHost "esx01.myside.local" -Type VMware +Connect-To -RemoteHost "vcr.myside.local" -Type CisServer ``` diff --git a/docs/about_PSCredentialStore.md b/docs/about_PSCredentialStore.md index 8a11b43..6b1b11f 100644 --- a/docs/about_PSCredentialStore.md +++ b/docs/about_PSCredentialStore.md @@ -70,15 +70,18 @@ If you have already installed the underlying framework your can connect to: * Required Modules: [`DataONTAP`](http://mysupport.netapp.com/tools/info/ECMLP2310788I.html?productID=61926) * **VMware** - Establish a connection to a VMware vCenter or ESXi host. * Required Modules: [`VMware.VimAutomation.Core`](https://www.powershellgallery.com/packages/VMware.PowerCLI) +* **CisServer** - Establish a connection to the CisServer Service on vCenter Host. + * Required Modules: [`VMware.VimAutomation.Cis.Core`](https://www.powershellgallery.com/packages/VMware.PowerCLI)) # EXAMPLES + ```powershell Connect-To -RemoteHost "ucs.myside.local" -Type CiscoUcs Connect-To -RemoteHost "ftp.myside.local" -Type FTP Connect-To -RemoteHost "fas.myside.local" -Type NetAppFAS Connect-To -RemoteHost "esx01.myside.local" -Type VMware +Connect-To -RemoteHost "vcr.myside.local" -Type CisServer ``` - # NOTE -- 2.45.2 From 855cb920c8900d7de8458ab8be31d114e524f23f Mon Sep 17 00:00:00 2001 From: Marco Blessing Date: Mon, 23 Oct 2017 08:11:25 +0200 Subject: [PATCH 04/11] Set theme jekyll-theme-midnight --- docs/_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_config.yml b/docs/_config.yml index cc35c1d..1885487 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1 +1 @@ -theme: jekyll-theme-modernist \ No newline at end of file +theme: jekyll-theme-midnight \ No newline at end of file -- 2.45.2 From a69f68c19bd718d1b4524155ec2c184d579b4095 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 23 Oct 2017 08:20:24 +0200 Subject: [PATCH 05/11] markdown code block in cbh notes added to cleanup platyPS output --- src/ChallengeFile/Get-ChallengeFile.ps1 | 3 ++- src/Connection/Connect-To.ps1 | 2 ++ src/Connection/Disconnect-From.ps1 | 2 ++ src/Helper/Get-RandomKey.ps1 | 2 ++ src/Helper/Resolve-Dependency.ps1 | 2 ++ src/Helper/Test-Module.ps1 | 2 ++ src/Item/Get-CredentialStoreItem.ps1 | 3 ++- src/Item/New-CredentialStoreItem.ps1 | 3 ++- src/Item/Remove-CredentialStoreItem.ps1 | 2 ++ src/Item/Set-CredentialStoreItem.ps1 | 2 ++ src/Item/Test-CredentialStoreItem.ps1 | 2 ++ src/Store/Get-CredentialStore.ps1 | 3 ++- src/Store/New-CredentialStore.ps1 | 3 ++- src/Store/Test-CredentialStore.ps1 | 3 ++- 14 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/ChallengeFile/Get-ChallengeFile.ps1 b/src/ChallengeFile/Get-ChallengeFile.ps1 index e4062f0..b5af369 100644 --- a/src/ChallengeFile/Get-ChallengeFile.ps1 +++ b/src/ChallengeFile/Get-ChallengeFile.ps1 @@ -19,10 +19,11 @@ function Get-ChallengeFile { .\Get-RandomKey -Path "C:\TMP\Challenge.bin" .NOTES + ``` File Name : Get-ChallengeFile.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : - + ``` .LINK https://github.com/OCram85/PSCredentialStore #> diff --git a/src/Connection/Connect-To.ps1 b/src/Connection/Connect-To.ps1 index 7c172bf..de92e5c 100644 --- a/src/Connection/Connect-To.ps1 +++ b/src/Connection/Connect-To.ps1 @@ -61,9 +61,11 @@ function Connect-To { Disconnect-From -RemoteHost "vcr01.myside.local" -Type VMware .NOTES + ``` File Name : Connect-To.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : + ``` .LINK https://github.com/OCram85/PSCredentialStore diff --git a/src/Connection/Disconnect-From.ps1 b/src/Connection/Disconnect-From.ps1 index 4756768..b67686a 100644 --- a/src/Connection/Disconnect-From.ps1 +++ b/src/Connection/Disconnect-From.ps1 @@ -48,9 +48,11 @@ function Disconnect-From { Disconnect-From -RemoteHost "vcenter.myside.local" -Type CisServer .NOTES + ``` File Name : Disconnect-From.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : + ``` .LINK https://github.com/OCram85/PSCredentialStore diff --git a/src/Helper/Get-RandomKey.ps1 b/src/Helper/Get-RandomKey.ps1 index b1ea7e3..206f400 100644 --- a/src/Helper/Get-RandomKey.ps1 +++ b/src/Helper/Get-RandomKey.ps1 @@ -19,9 +19,11 @@ function Get-RandomKey { .\Get-RandomKey -Size 24 .NOTES + ``` File Name : Get-RandomKey.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : + ``` .LINK https://github.com/OCram85/PSCredentialStore diff --git a/src/Helper/Resolve-Dependency.ps1 b/src/Helper/Resolve-Dependency.ps1 index 9d76571..1687275 100644 --- a/src/Helper/Resolve-Dependency.ps1 +++ b/src/Helper/Resolve-Dependency.ps1 @@ -40,9 +40,11 @@ function Resolve-Dependency { } .NOTES + ``` File Name : ResolveDependency.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : + ``` .LINK https://github.com/OCram85/PSCredentialStore diff --git a/src/Helper/Test-Module.ps1 b/src/Helper/Test-Module.ps1 index 7f18f95..75d7720 100644 --- a/src/Helper/Test-Module.ps1 +++ b/src/Helper/Test-Module.ps1 @@ -34,9 +34,11 @@ function Test-Module { .\Test-Dependency -Name 'VMware.PowerCLI' -Type 'Module' -StopIfFails .NOTES + ``` File Name : Get-RandomKey.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : + ``` .LINK https://github.com/OCram85/PSCredentialStore diff --git a/src/Item/Get-CredentialStoreItem.ps1 b/src/Item/Get-CredentialStoreItem.ps1 index 4236c50..52ad70a 100644 --- a/src/Item/Get-CredentialStoreItem.ps1 +++ b/src/Item/Get-CredentialStoreItem.ps1 @@ -31,10 +31,11 @@ function Get-CredentialStoreItem { $myCreds = Get-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local" .NOTES + ``` File Name : Get-CredentialStoreItem.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : - + ``` .LINK https://github.com/OCram85/PSCredentialStore #> diff --git a/src/Item/New-CredentialStoreItem.ps1 b/src/Item/New-CredentialStoreItem.ps1 index b643659..e431c01 100644 --- a/src/Item/New-CredentialStoreItem.ps1 +++ b/src/Item/New-CredentialStoreItem.ps1 @@ -31,10 +31,11 @@ function New-CredentialStoreItem { New-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local" .NOTES + ``` File Name : New-CredentialStoreItem.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : - + ``` .LINK https://github.com/OCram85/PSCredentialStore #> diff --git a/src/Item/Remove-CredentialStoreItem.ps1 b/src/Item/Remove-CredentialStoreItem.ps1 index b82cd27..00f21b2 100644 --- a/src/Item/Remove-CredentialStoreItem.ps1 +++ b/src/Item/Remove-CredentialStoreItem.ps1 @@ -31,9 +31,11 @@ function Remove-CredentialStoreItem { Remove-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local" -Identifier svc .NOTES + ``` File Name : Remove-CredentialStoreItem.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : + ``` .LINK https://github.com/OCram85/PSCredentialStore diff --git a/src/Item/Set-CredentialStoreItem.ps1 b/src/Item/Set-CredentialStoreItem.ps1 index 6f35fe8..7cbcb28 100644 --- a/src/Item/Set-CredentialStoreItem.ps1 +++ b/src/Item/Set-CredentialStoreItem.ps1 @@ -30,9 +30,11 @@ function Set-CredentialStoreItem { Set-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local" -Identifier svc .NOTES + ``` File Name : Set-CredentialStoreItem.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : + ``` .LINK https://github.com/OCram85/PSCredentialStore diff --git a/src/Item/Test-CredentialStoreItem.ps1 b/src/Item/Test-CredentialStoreItem.ps1 index 56e9c9d..692befb 100644 --- a/src/Item/Test-CredentialStoreItem.ps1 +++ b/src/Item/Test-CredentialStoreItem.ps1 @@ -37,9 +37,11 @@ function Test-CredentialStoreItem() { } .NOTES + ``` File Name : Test-CredentialStoreItem.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : + ``` .LINK https://github.com/OCram85/PSCredentialStore diff --git a/src/Store/Get-CredentialStore.ps1 b/src/Store/Get-CredentialStore.ps1 index 8828d92..8e26930 100644 --- a/src/Store/Get-CredentialStore.ps1 +++ b/src/Store/Get-CredentialStore.ps1 @@ -25,10 +25,11 @@ function Get-CredentialStore { $CSContent = Get-CredentialStore -Path "C:\TMP\mystore.json" .NOTES + ``` File Name : Get-CredentialStore.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : - + ``` .LINK https://github.com/OCram85/PSCredentialStore #> diff --git a/src/Store/New-CredentialStore.ps1 b/src/Store/New-CredentialStore.ps1 index 6bbe19f..a688f2d 100644 --- a/src/Store/New-CredentialStore.ps1 +++ b/src/Store/New-CredentialStore.ps1 @@ -41,10 +41,11 @@ function New-CredentialStore { # Creates a new shared CredentialStore in the given location. .NOTES + ``` File Name : New-CredentialStore.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : - + ``` .LINK https://github.com/OCram85/PSCredentialStore #> diff --git a/src/Store/Test-CredentialStore.ps1 b/src/Store/Test-CredentialStore.ps1 index cf72109..34101c3 100644 --- a/src/Store/Test-CredentialStore.ps1 +++ b/src/Store/Test-CredentialStore.ps1 @@ -15,10 +15,11 @@ function Test-CredentialStore { can be decrypted across systems. .NOTES + ``` File Name : Test-CredentialStore.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : - + ``` .LINK https://github.com/OCram85/PSCredentialStore #> -- 2.45.2 From d364c09f29137b976fe94e694367cb41ecfaa49c Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 23 Oct 2017 08:24:37 +0200 Subject: [PATCH 06/11] update platPS docs --- docs/Connect-To.md | 29 ++++++++++++++++++++++++----- docs/Disconnect-From.md | 18 +++++++++++++----- docs/Get-CredentialStore.md | 2 ++ docs/Get-CredentialStoreItem.md | 2 ++ docs/New-CredentialStore.md | 2 ++ docs/New-CredentialStoreItem.md | 2 ++ docs/Remove-CredentialStoreItem.md | 2 ++ docs/Set-CredentialStoreItem.md | 2 ++ docs/Test-CredentialStore.md | 2 ++ docs/Test-CredentialStoreItem.md | 2 ++ 10 files changed, 53 insertions(+), 10 deletions(-) diff --git a/docs/Connect-To.md b/docs/Connect-To.md index 34d42fc..01277b5 100644 --- a/docs/Connect-To.md +++ b/docs/Connect-To.md @@ -34,12 +34,28 @@ Establish a connection to the selected host using a stored CredentialStoreItem. Connect-To -RemoteHost "ucs.myside.local" -Type CiscoUcs ``` -Connect-To -RemoteHost "ftp.myside.local" -Type FTP -Connect-To -RemoteHost "fas.myside.local" -Type NetAppFAS -Connect-To -RemoteHost "esx01.myside.local" -Type VMware - ### -------------------------- EXAMPLE 2 -------------------------- ``` +Connect-To -RemoteHost "ftp.myside.local" -Type FTP +``` + +### -------------------------- EXAMPLE 3 -------------------------- +``` +Connect-To -RemoteHost "fas.myside.local" -Type NetAppFAS +``` + +### -------------------------- EXAMPLE 4 -------------------------- +``` +Connect-To -RemoteHost "esx01.myside.local" -Type VMware +``` + +### -------------------------- EXAMPLE 5 -------------------------- +``` +Connect-To -RemoteHost "vCenter.myside.local" -Type CisServer +``` + +### -------------------------- EXAMPLE 6 -------------------------- +``` $MyCreds = Get-Credential ``` @@ -88,6 +104,7 @@ Currently implemented targets are: - FTP Establish a connection to a FTP host. - NetAppFAS Establish a connection to a NetApp Clustered ONTAP filer. - VMware Establish a connection to a VMware vCenter or ESXi host. + - CisServer Establish a connection to a Vmware CisServer. ```yaml Type: String @@ -164,9 +181,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### [None] ## NOTES +\`\`\` File Name : Connect-To.ps1 Author : Marco Blessing - marco.blessing@googlemail.com -Requires : PSFTP, PowerCLI +Requires : +\`\`\` ## RELATED LINKS diff --git a/docs/Disconnect-From.md b/docs/Disconnect-From.md index c54f2f9..dda7e88 100644 --- a/docs/Disconnect-From.md +++ b/docs/Disconnect-From.md @@ -46,6 +46,11 @@ Disconnect-From -RemoteHost "esx01.myside.local" -Type VMware Disconnect-From -RemoteHost "esx01.myside.local" -Type VMware -Force:$True ``` +### -------------------------- EXAMPLE 6 -------------------------- +``` +Disconnect-From -RemoteHost "vcenter.myside.local" -Type CisServer +``` + ## PARAMETERS ### -RemoteHost @@ -66,10 +71,11 @@ Accept wildcard characters: False ### -Type Specify the host type of the target. Currently implemented targets are: - - CiscoUcs Establish a connection to a Cisco UCS Fabric Interconnect. - - FTP Establish a connection to a FTP host. - - NetAppFAS Establish a connection to a NetApp Clustered ONTAP filer. - - VMware Establish a connection to a VMware vCenter or ESXi host. + - CiscoUcs Terminates the connection from a Cisco UCS Fabric Interconnect. + - FTP Terminates the connection from a FTP host. + - NetAppFAS Terminates the connection from a NetApp Clustered ONTAP filer. + - VMware Terminates the connection from a VMware vCenter or ESXi host. + - CisServer Terminates the connection from a Vmware CisServer. ```yaml Type: String @@ -110,9 +116,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### [None] ## NOTES -File Name : Disconnect-To.ps1 +\`\`\` +File Name : Disconnect-From.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : +\`\`\` ## RELATED LINKS diff --git a/docs/Get-CredentialStore.md b/docs/Get-CredentialStore.md index b175055..dc32b47 100644 --- a/docs/Get-CredentialStore.md +++ b/docs/Get-CredentialStore.md @@ -82,9 +82,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### [PSObject] Returns the credential store content as PSObject. ## NOTES +\`\`\` File Name : Get-CredentialStore.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : +\`\`\` ## RELATED LINKS diff --git a/docs/Get-CredentialStoreItem.md b/docs/Get-CredentialStoreItem.md index b0f4095..bd1c5cf 100644 --- a/docs/Get-CredentialStoreItem.md +++ b/docs/Get-CredentialStoreItem.md @@ -112,9 +112,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### [System.Management.Automation.PSCredential] ## NOTES +\`\`\` File Name : Get-CredentialStoreItem.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : +\`\`\` ## RELATED LINKS diff --git a/docs/New-CredentialStore.md b/docs/New-CredentialStore.md index b0f4095..bd1c5cf 100644 --- a/docs/New-CredentialStore.md +++ b/docs/New-CredentialStore.md @@ -112,9 +112,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### [System.Management.Automation.PSCredential] ## NOTES +\`\`\` File Name : Get-CredentialStoreItem.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : +\`\`\` ## RELATED LINKS diff --git a/docs/New-CredentialStoreItem.md b/docs/New-CredentialStoreItem.md index 0ad01f7..eb5a7ff 100644 --- a/docs/New-CredentialStoreItem.md +++ b/docs/New-CredentialStoreItem.md @@ -130,9 +130,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### [None] ## NOTES +\`\`\` File Name : New-CredentialStoreItem.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : +\`\`\` ## RELATED LINKS diff --git a/docs/Remove-CredentialStoreItem.md b/docs/Remove-CredentialStoreItem.md index 005b52c..7f0f540 100644 --- a/docs/Remove-CredentialStoreItem.md +++ b/docs/Remove-CredentialStoreItem.md @@ -113,9 +113,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### [None] ## NOTES +\`\`\` File Name : Remove-CredentialStoreItem.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : +\`\`\` ## RELATED LINKS diff --git a/docs/Set-CredentialStoreItem.md b/docs/Set-CredentialStoreItem.md index 80b1b02..9f15422 100644 --- a/docs/Set-CredentialStoreItem.md +++ b/docs/Set-CredentialStoreItem.md @@ -113,9 +113,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### [None] ## NOTES +\`\`\` File Name : Set-CredentialStoreItem.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : +\`\`\` ## RELATED LINKS diff --git a/docs/Test-CredentialStore.md b/docs/Test-CredentialStore.md index 80756f6..de4f824 100644 --- a/docs/Test-CredentialStore.md +++ b/docs/Test-CredentialStore.md @@ -78,9 +78,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS ## NOTES +\`\`\` File Name : Test-CredentialStore.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : +\`\`\` ## RELATED LINKS diff --git a/docs/Test-CredentialStoreItem.md b/docs/Test-CredentialStoreItem.md index 5a71c58..bccadf3 100644 --- a/docs/Test-CredentialStoreItem.md +++ b/docs/Test-CredentialStoreItem.md @@ -121,9 +121,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### [None] ## NOTES +\`\`\` File Name : Test-CredentialStoreItem.ps1 Author : Marco Blessing - marco.blessing@googlemail.com Requires : +\`\`\` ## RELATED LINKS -- 2.45.2 From b92cb2609bb0e80004d5bbfdd2aca122380ddaf1 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 23 Oct 2017 09:54:40 +0200 Subject: [PATCH 07/11] modularize PSGallery Deployment branch --- appveyor.yml | 4 ++-- tools/AppVeyor.psm1 | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d900c21..65f7e79 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -52,5 +52,5 @@ deploy: on: branch: dev # release from master branch only -#after_deploy: -# - ps: Invoke-AppVeyorPSGallery +after_deploy: + - ps: Invoke-AppVeyorPSGallery -OnBranch 'master' diff --git a/tools/AppVeyor.psm1 b/tools/AppVeyor.psm1 index 58f916d..cd63f10 100644 --- a/tools/AppVeyor.psm1 +++ b/tools/AppVeyor.psm1 @@ -138,7 +138,11 @@ Function Invoke-CoverageReport() { Function Invoke-AppVeyorPSGallery() { [CmdletBinding()] - Param() + Param( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [String]$OnBranch + ) Expand-Archive -Path (".\bin\{0}.zip" -f $CALLSIGN) -DestinationPath ("C:\Users\appveyor\Documents\WindowsPowerShell\Modules\{0}\" -f $CALLSIGN) -Verbose Import-Module -Name $CALLSIGN -Verbose -Force Write-Host "Available Package Provider:" -ForegroundColor Yellow -- 2.45.2 From 6e9cc439fd5d2f42363e0196dd93c4f2eaee2bc7 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 23 Oct 2017 09:57:58 +0200 Subject: [PATCH 08/11] test multi gh deployment provider --- appveyor.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 65f7e79..7223d82 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -50,7 +50,15 @@ deploy: draft: true prerelease: true on: - branch: dev # release from master branch only + branch: dev + - provider: GitHub + auth_token: + secure: M+bBX5/nKdJB0eViP7xtrLVTwf3vGDUA9N2MMprZp2i+9ZR3CBVcJnSzJWUmalhB + artifact: PSCredentialStore.zip # upload all NuGet packages to release assets + draft: false + prerelease: false + on: + branch: master # release from master branch only after_deploy: - ps: Invoke-AppVeyorPSGallery -OnBranch 'master' -- 2.45.2 From 455bb662a4e65d615d420bf3d31b5a660b6bfce9 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 23 Oct 2017 10:22:11 +0200 Subject: [PATCH 09/11] installation of dependencies moved to ps function --- appveyor.yml | 9 +-------- tools/AppVeyor.psm1 | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7223d82..88d3d95 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,15 +14,8 @@ image: Visual Studio 2017 # Install pester module and init the Appveyor support. install: - - ps: Install-PackageProvider -Name NuGet -MinimumVersion '2.8.5.201' -Force -Verbose - - ps: Import-PackageProvider NuGet -MinimumVersion '2.8.5.201' -Force - - ps: Install-Module -Name 'Pester' -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber - - ps: Update-Module 'Pester' - - ps: Install-Module -Name 'posh-git' -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber - - ps: Update-Module 'posh-git' - - ps: Install-Module -Name 'PSCoverage' -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber - - ps: Import-Module 'PSCoverage' - ps: Import-Module .\tools\AppVeyor.psm1 + - ps: Invoke-InstallDependencies environment: NuGetToken: diff --git a/tools/AppVeyor.psm1 b/tools/AppVeyor.psm1 index cd63f10..de78763 100644 --- a/tools/AppVeyor.psm1 +++ b/tools/AppVeyor.psm1 @@ -9,6 +9,32 @@ $CALLSIGN = 'PSCredentialStore' Write-Host ("Callsign is: {0}" -f $CALLSIGN) -ForegroundColor Yellow + +Function Invoke-InstallDependencies() { + [CmdletBinding()] + Param() + + Process { + Try { + Install-PackageProvider -Name NuGet -RequiredVersion '2.8.5.208' -Force -Verbose + Import-PackageProvider -Name NuGet -RequiredVersion '2.8.5.208' -Force + Install-Module -Name 'Pester' -Scope CurrentUser -RequiredVersion '4.0.8' -Force -SkipPublisherCheck -AllowClobber + Install-Module -Name 'posh-git' -Scope CurrentUser -RequiredVersion '0.7.1' -Force -SkipPublisherCheck -AllowClobber + Install-Module -Name 'PSCoverage' -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber + Import-Module -Name 'Pester', 'posh-git', 'PSCoverage' + } + Catch { + $MsgParams = @{ + Message = 'Could not install the required dependencies!' + Category = 'Error' + Details = $_.Exception.Message + } + Add-AppveyorMessage @MsgParams + Throw $MsgParams.Message + } + + } +} Function Invoke-AppVeyorBumpVersion() { [CmdletBinding()] Param() -- 2.45.2 From 684b553c735173d4ef62e6a763f43695bca05876 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 23 Oct 2017 10:25:06 +0200 Subject: [PATCH 10/11] gh deployment for dev branch removed. duplicate deployment. see appveyor artifacts. --- appveyor.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 88d3d95..b89a575 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -36,14 +36,14 @@ test_script: - ps: Invoke-CoverageReport deploy: - - provider: GitHub - auth_token: - secure: M+bBX5/nKdJB0eViP7xtrLVTwf3vGDUA9N2MMprZp2i+9ZR3CBVcJnSzJWUmalhB - artifact: PSCredentialStore.zip # upload all NuGet packages to release assets - draft: true - prerelease: true - on: - branch: dev + #- provider: GitHub + # auth_token: + # secure: M+bBX5/nKdJB0eViP7xtrLVTwf3vGDUA9N2MMprZp2i+9ZR3CBVcJnSzJWUmalhB + # artifact: PSCredentialStore.zip # upload all NuGet packages to release assets + # draft: true + # prerelease: true + # on: + # branch: dev - provider: GitHub auth_token: secure: M+bBX5/nKdJB0eViP7xtrLVTwf3vGDUA9N2MMprZp2i+9ZR3CBVcJnSzJWUmalhB -- 2.45.2 From 581131c43675d48e768f3d00dd0f4a3d9cb5daee Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 23 Oct 2017 10:29:11 +0200 Subject: [PATCH 11/11] add verbose output for pre flight checks --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index b89a575..c009088 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,7 @@ image: Visual Studio 2017 # Install pester module and init the Appveyor support. install: - ps: Import-Module .\tools\AppVeyor.psm1 - - ps: Invoke-InstallDependencies + - ps: Invoke-InstallDependencies -Verbose environment: NuGetToken: -- 2.45.2