You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error is due to not listing a position for any of the parameters in the function. You mention in your guidelines to use explicit parameter names and not assume position, which is good, but if you don't have position set for any of the parameters, you prevent the use of your function without explicitly naming the parameters when calling it.
So you either need to always use named parameters: Get-ADSIComputer -Identity $env:COMPUTERNAME
Or adjust the $Identity parameter line to allow it to accept positional input: param ([Parameter(Mandatory=$true,Position=0,ParameterSetName="Identity")])
When using Get-ADSIComputer $ComputerName
I'm getting the following error
Get-AdsiComputer $env:COMPUTERNAME
Get-ADSIComputer : A positional parameter cannot be found that accepts argument ''.
At line:1 char:1
The text was updated successfully, but these errors were encountered: