They are functionally equivalent. -Command
is the only parameter that accepts a cmdlet that is not in the CommonParameters
set, and the first (by default, since it is the only one) when it is used positionally.
Everything you do with the second example is explicit with your parameter, instead of relying on position. This is a good habit. Verbose, but in the future, and this makes your intention perfectly clear.
alroc source share