Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

feat: add pscredential and securestring - #283

Merged
tenthirtyam merged 1 commit into
vmware:developfrom
erikgraa:enhancement/pscredentialset-redux
Sep 25, 2024
Merged

feat: add pscredential and securestring#283
tenthirtyam merged 1 commit into
vmware:developfrom
erikgraa:enhancement/pscredentialset-redux

Conversation

@erikgraa

@erikgraa erikgraa commented Jul 9, 2024

Copy link
Copy Markdown
Contributor

Summary

Enhanced Request-VCFToken and Connect-CloudBuilder by adding a PSCredential parameter set and adding support for SecureString for the Password parameter.

I've tested the following:

SDDC Manager

  1. Use a clear-text string password.
Request-VCFToken -fqdn <fqdn> -username administrator@vsphere.local -password <plainTextPassword>
  1. Use a SecureString password.
$secureString = Read-Host -AsSecureString 'Password'
Request-VCFToken -fqdn <fqdn> -username administrator@vsphere.local -password $secureString
  1. Use a SecureString as password.
Request-VCFToken -fqdn <fqdn> -username administrator@vsphere.local
  1. Use a PSCredential object.
$credential = Get-Credential
Request-VCFToken -fqdn <fqdn> -credential $credential
  1. Provide a PSCredential object (username/password).
Request-VCFToken -fqdn <fqdn>

Cloud Builder

  1. Use a clear-text string password.
Connect-CloudBuilder -fqdn <fqdn> -username admin -password <plainTextPassword>
  1. Use a SecureString password.
$secureString = Read-Host -AsSecureString 'Password'
Connect-CloudBuilder -fqdn <fqdn> -username admin -password $secureString
  1. Use a SecureString as password.
Connect-CloudBuilder -fqdn <fqdn> -username admin
  1. Use a PSCredential object.
$credential = Get-Credential
Connect-CloudBuilder -fqdn <fqdn> -credential $credential
  1. Provide a PSCredential object (username/password).
Connect-CloudBuilder -fqdn <fqdn>

Will ask for a PSCredential (username/password).

Type

  • Bugfix
  • Enhancement or Feature
  • Code Style or Formatting
  • Documentation
  • Refactoring
  • Chore
  • Other
    Please describe:

Breaking Changes?

  • Yes, there are breaking changes.
  • No, there are no breaking changes.

Test and Documentation

  • Tests have been completed.
  • Documentation has been added or updated.

Issue References

A furthering of #116

Additional Information

N/A

@vmwclabot vmwclabot added the dco-required Developer Certificate of Origin Sign-off Required label Jul 9, 2024
@github-actions github-actions Bot added documentation Documentation needs-review Needs Review labels Jul 9, 2024
@erikgraa
erikgraa force-pushed the enhancement/pscredentialset-redux branch from 89cf38a to e8d6616 Compare July 9, 2024 13:13
@vmwclabot vmwclabot removed the dco-required Developer Certificate of Origin Sign-off Required label Jul 9, 2024

@tenthirtyam tenthirtyam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please retain the use of camelCase parameters fqdn, username, and password?

Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated

@tenthirtyam tenthirtyam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some changes and comments provided.

@vmwclabot vmwclabot added the dco-required Developer Certificate of Origin Sign-off Required label Jul 9, 2024
@erikgraa
erikgraa force-pushed the enhancement/pscredentialset-redux branch from 8f55fd3 to 79f7b82 Compare July 9, 2024 22:07
@vmwclabot vmwclabot added dco-required Developer Certificate of Origin Sign-off Required and removed dco-required Developer Certificate of Origin Sign-off Required labels Jul 9, 2024
@erikgraa
erikgraa force-pushed the enhancement/pscredentialset-redux branch 3 times, most recently from 9dc5e8a to 99ee156 Compare July 11, 2024 17:58
@vmwclabot vmwclabot removed the dco-required Developer Certificate of Origin Sign-off Required label Jul 11, 2024

@erikgraa erikgraa left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed back to camelcase!

@erikgraa
erikgraa requested a review from tenthirtyam July 12, 2024 01:23
@tenthirtyam tenthirtyam changed the title feat: Enhanced Request-VCFToken and Connect-CloudBuilder by adding a PSCredential parameter set and adding support for SecureString for the Password parameter feat: add pscredential and securestring Jul 12, 2024
@erikgraa

Copy link
Copy Markdown
Contributor Author

Some changes and comments provided.

Hi @tenthirtyam, let me know if something else needs refinement before this PR is ready to merge 👍🏻

@tenthirtyam tenthirtyam added this to the Backlog milestone Sep 22, 2024
@vmware vmware deleted a comment from vmwclabot Sep 22, 2024
@vmware vmware deleted a comment from vmwclabot Sep 22, 2024
@vmware vmware deleted a comment from vmwclabot Sep 22, 2024
@vmware vmware deleted a comment from vmwclabot Sep 22, 2024
@vmware vmware deleted a comment from vmwclabot Sep 22, 2024
@vmware vmware deleted a comment from vmwclabot Sep 22, 2024
@vmware vmware deleted a comment from vmwclabot Sep 22, 2024
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread docs/documentation/functions/authentication/Request-VCFToken.md Outdated
Comment thread docs/documentation/functions/authentication/Request-VCFToken.md Outdated
Comment thread docs/documentation/functions/authentication/Request-VCFToken.md Outdated
Comment thread docs/documentation/functions/authentication/Connect-CloudBuilder.md Outdated
Comment thread docs/documentation/functions/authentication/Request-VCFToken.md Outdated
Comment thread docs/documentation/functions/authentication/Request-VCFToken.md Outdated
Comment thread docs/documentation/functions/authentication/Request-VCFToken.md Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated
Comment thread PowerVCF.psm1 Outdated

@tenthirtyam tenthirtyam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes.

@erikgraa erikgraa left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tenthirtyam
tenthirtyam force-pushed the enhancement/pscredentialset-redux branch from cd82f5e to e64714f Compare September 25, 2024 02:14
@tenthirtyam
tenthirtyam self-requested a review September 25, 2024 02:15
@tenthirtyam

tenthirtyam commented Sep 25, 2024

Copy link
Copy Markdown
Contributor

I've force-pushed a couple more changes to ensure each cmdlet uses the same structure and that the documenation is a match. e64714f

Thus far this looks good but I want to run some tests before next steps.

@tenthirtyam tenthirtyam modified the milestones: Backlog, v2.5.0 Sep 25, 2024
Enhanced `Request-VCFToken` and `Connect-CloudBuilder` by adding a `PSCredential `parameter set and adding support for `SecureString` or PSCredential object for the `password` parameter.

Signed-off-by: Erik Grina Raassum <erik.raassum@gmail.com>
Co-Authored-By: Ryan Johnson <ryan@tenthirtyam.org>
@tenthirtyam
tenthirtyam force-pushed the enhancement/pscredentialset-redux branch from e64714f to c41652d Compare September 25, 2024 02:30

@tenthirtyam tenthirtyam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've have successfully tested these changes in one of our development environments with the following:

SDDC Manager

Request-VCFToken -fqdn sfo-vcf01.sfo.rainpole.io -username administrator@vsphere.local -password VMw@re1!

$secureString = Read-Host -AsSecureString 'Password'
Request-VCFToken -fqdn sfo-vcf01.sfo.rainpole.io -username administrator@vsphere.local -password $secureString

$credential = Get-Credential
Request-VCFToken -fqdn sfo-vcf01.sfo.rainpole.io -credential $credential

Request-VCFToken -fqdn sfo-vcf01.sfo.rainpole.io -username administrator@vsphere.local

Request-VCFToken -fqdn sfo-vcf01.sfo.rainpole.io

Cloud Builder

Connect-CloudBuilder -fqdn sfo-cb01.sfo.rainpole.io -username admin -password VMw@re1!VMw@re1!

$secureString = Read-Host -AsSecureString 'Password'
Connect-CloudBuilder -fqdn sfo-cb01.sfo.rainpole.io -username admin -password $secureString

$credential = Get-Credential
Connect-CloudBuilder -fqdn sfo-cb01.sfo.rainpole.io -credential $credential

Connect-CloudBuilder -fqdn sfo-cb01.sfo.rainpole.io -username admin

Connect-CloudBuilder -fqdn sfo-cb01.sfo.rainpole.io

LGTM! 🚀

@tenthirtyam tenthirtyam removed the needs-review Needs Review label Sep 25, 2024
@tenthirtyam
tenthirtyam merged commit 1b5f01b into vmware:develop Sep 25, 2024
@vmware vmware locked as resolved and limited conversation to collaborators Mar 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

documentation Documentation enhancement Enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants