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

Improved the RSAT installation process #93

Merged
merged 2 commits into from
Jan 14, 2024

Conversation

techspence
Copy link
Collaborator

To resolve this issue I created two new functions:

  • TestIsRSATInstalled which returns true if the RSAT AD PowerShell module is installed or false if not
  • InstallRSATADPowerShell which installs the RSAT AD PowerShell module

Invoke-Locksmith now has a simple check for the RSAT AD PowerShell module and calls the install function when needed.

Please let me know if you see/experience any issues testing this. "It works on my system." :D

.EXAMPLE
Test-IsElevated
#>
if (-not(Get-Module -Name 'ActiveDirectory' -ListAvailable)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The -not condition here flips your if/true logic. Just need to either remove -net or swap your $true and $false outputs. :)

Copy link
Owner

Choose a reason for hiding this comment

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

I agree with Sam here. Instead of having a -not here and a -not in the public Invoke-Locksmith function:
image
I'd rather both -nots be removed. It makes the logic easier to understand.

Copy link
Owner

@TrimarcJake TrimarcJake left a comment

Choose a reason for hiding this comment

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

Remove both -nots as discussed, and this should be g2g.

.EXAMPLE
Test-IsElevated
#>
if (-not(Get-Module -Name 'ActiveDirectory' -ListAvailable)) {
Copy link
Owner

Choose a reason for hiding this comment

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

I agree with Sam here. Instead of having a -not here and a -not in the public Invoke-Locksmith function:
image
I'd rather both -nots be removed. It makes the logic easier to understand.

@TrimarcJake TrimarcJake merged commit 3de50b3 into TrimarcJake:testing Jan 14, 2024
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

3 participants