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

Make Get-DbaPrivilege more efficient #9436

Merged

Conversation

mrahman-DBA
Copy link
Contributor

Perform both the data extract and clean-up of the security policy file in just one trip to the remote computer(s). The extract is saved into the object $secPol, and further processing is made from only this object, which saves having to reach out to the remote computer(s) multiple times.

Type of Change

  • Bug fix (non-breaking change, fixes # )
  • New feature (non-breaking change, adds functionality, fixes # )
  • Breaking change (affects multiple commands or functionality, fixes # )
  • Ran manual Pester test and has passed (.\tests\manual.pester.ps1)
  • Adding code coverage to existing functionality
  • Pester test is included
  • If new file reference added for test, has is been added to github.com/dataplat/appveyor-lab ?
  • Unit test is included
  • Documentation
  • Build system

Purpose

Make code more efficient

Approach

The cmdlet was making multiple trips to the computer(s) to get data for each of the security policies. The code has been updated so that only one trip is made to the remote computer(s) and the data is saved into the $secPol object. Then further processing is made from only this object, which saves multiple trips to the remote computer(s)

Perform both the data extract and clean-up of the security policy file in just one trip to the remote computer. The extract is saved into the variable $secPol, and further processing is made from this variable only, which saves having to reach out to the remote computer multiple times.
@andreasjordan
Copy link
Contributor

I like the idea of this pull request. I hope to find some time to do a review and test that in my lab.

@andreasjordan
Copy link
Contributor

Our tests show:

Describe : dbatools style
Context : formatting
Name : It Get-DbaPrivilege.ps1 is not compliant with the OTBS formatting style. Please run Invoke-DbatoolsFormatter against the failing file and commit the changes.
Result : Failed
Message : Expected 0, but got 1.

Please have a look at the format of your changes.

Ran Invoke-DbatoolsFormatter against the script to ensure script format meets dbatools standards
@mrahman-DBA
Copy link
Contributor Author

mrahman-DBA commented Jul 30, 2024

Formatting updates have been committed

@niphlod
Copy link
Contributor

niphlod commented Jul 31, 2024

yeah it now checks out fine

@potatoqualitee
Copy link
Member

Nice changes, thank you very much 🤩

@potatoqualitee potatoqualitee merged commit a6634cc into dataplat:development Aug 4, 2024
3 checks passed
@mrahman-DBA
Copy link
Contributor Author

Thank you!

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.

4 participants