This is more of a suggestion that an issue.
I suggest removing the assumptive nature of the Forest and Domain Parameters using :
[Parameter(ParameterSetName = 'Domain')]
$DomainName = [System.DirectoryServices.ActiveDirectory.Domain]::Getcurrentdomain(),
[Parameter(ParameterSetName = 'Forest')]
$ForestName = [System.DirectoryServices.ActiveDirectory.Forest]::Getcurrentforest(),
This caused an issue when I was running the commands from a non-domain joined system. Even when I was providing the Parameters with my own values they would still fail - The only fix I was able to come up with was removing these default values.
This is more of a suggestion that an issue.
I suggest removing the assumptive nature of the Forest and Domain Parameters using :
This caused an issue when I was running the commands from a non-domain joined system. Even when I was providing the Parameters with my own values they would still fail - The only fix I was able to come up with was removing these default values.