Closed rnelson0 closed 8 years ago
Snark - shouldn't everyone have VUM? Kidding. And you're right. I think we can easily test this by making up bogus permissions and working on error handling to format an eyeballs friendly response using Write-Warning (as an example).
Ha, I don't have enough capacity on my two-host lab to do automatic updates, so... yeah :)
@rnelson0 - Check out this commit that reports missing permissions and try it in your environment?
https://github.com/chriswahl/vCenter-roles/commit/152ad9e981981a14f77f4e0375e5abd578488279
Awesome!
PS C:\users\RN7284\Documents\vCenter-roles> Import-VIRole -Name Test -Permission .\Roles\Administrator.json vcsa
WARNING: Permission named VcIntegrity.Baseline.com.vmware.vcIntegrity.AssignBaselines not found
WARNING: Permission named VcIntegrity.Baseline.com.vmware.vcIntegrity.ManageBaselines not found
WARNING: Permission named VcIntegrity.FileUpload.com.vmware.vcIntegrity.ImportFile not found
WARNING: Permission named VcIntegrity.General.com.vmware.vcIntegrity.Configure not found
WARNING: Permission named VcIntegrity.Updates.com.vmware.vcIntegrity.Remediate not found
WARNING: Permission named VcIntegrity.Updates.com.vmware.vcIntegrity.Scan not found
WARNING: Permission named VcIntegrity.Updates.com.vmware.vcIntegrity.Stage not found
WARNING: Permission named VcIntegrity.Updates.com.vmware.vcIntegrity.ViewStatus not found
Can you fix the indent on L118 before submitting a PR?
It's a nested curly brace, that's the correct format.
Submitted https://github.com/rnelson0/vCenter-roles/pull/5 for review
During testing of the new framework, I discovered that some sample privileges @chriswahl uses are from VUM, which is not part of my lab vCenter. As these privs do not exist, PoSH spews lots of red for each and every missing priv:
See if there's a better way to handle these errors and make the missing privs more visible to the calling user/cmdlet.