Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow script to be run from any location, add parameter validation, standardize output, remove EFS errors #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

davidseibel
Copy link

@davidseibel davidseibel commented Sep 12, 2018

The primary reason for this pull request is to allow this script to be run from any location (not just the users "Downloads" folder) and to give the configuration JSON file complete control of the paths for the PEM and credential files, which previously assumed that they were located in the current user profile.

Additionally, per best practices, the use of Write-Host was complete replaced with Write-Verbose, Write-Warning and Write-Error. Terminating usage of Write-Error was replaced with "throw". Both scripts were given parameter inputs to replace the user-interactive prompts. These parameters have help messages, are mandatory and do still prompt if the user fails to specify them, so the end-user experience is similar.

The old VMware PowerCLI snapin was referenced in this script. I have removed this and replaced it with a dependency on the VMware.PowerCLI module.

Finally, the requirement that Encrypting File System be in use is not effective. If the script fails to encrypt files because EFS is not running, the files are still generated and left on disk without encryption. Instead of failing, the script now warns that the files could not be encrypted.

- Add/Improve parameter validation
- Use config file as input to determine file locations
- Remove use of Write-Host, replace with Write-Verbose/Write-Warning/Write-Error
- Warn if EFS file encryption failed, instead of error
- Allow script to be run from any location
- Replace use of old VMware PowerCLI snapin with new module
- Replace use of Write-Host with Write-Verbose/Write-Warning/Write-Error
- Fix mistyped $sever_serial variable
@sopatnai
Copy link
Contributor

David, we have a planned release today to support Windows Servers. Can you please re-do your PR after today's push. We have not changed anything on the VMware side so you shouldn't see any conflicts.
I will go thru it and hopefully merge it the next few days.

Thanks for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants