Skip to content

Commit

Permalink
fixed beginprocessing method in base cmdlet
Browse files Browse the repository at this point in the history
  • Loading branch information
santisq committed Sep 3, 2024
1 parent cdb6737 commit 93a5c35
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/PSADTree/PSADTreeCmdletBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,20 @@ protected override void BeginProcessing()
{
try
{
if (Exclude is not null)
{
_exclusionPatterns = Exclude
.Select(e => new WildcardPattern(e, _wpoptions))
.ToArray();
}

if (Server is null)
{
_context = new PrincipalContext(ContextType.Domain);
return;
}

_context = new PrincipalContext(ContextType.Domain, Server);


if (Exclude is not null)
{
_exclusionPatterns = Exclude
.Select(e => new WildcardPattern(e, _wpoptions))
.ToArray();
}
}
catch (Exception exception)
{
Expand Down

0 comments on commit 93a5c35

Please sign in to comment.