Author Posts

October 11, 2013 at 12:36 pm

Is it possible to set an alias for a command ( or function ) and specify parameters? For a simplified example —

# define alias
set-alias -name show-members -value "Get-QADGroupMember -Identity $args"

# usage example

(I'm trying to do this with some custom functions I have given to users. )

Many thanks!

October 11, 2013 at 2:12 pm

Not an alias, no. Aliases are only nicknames for commands.

That said, there's nothing stopping you from defining a function that runs a command and uses specific parameters. That's what "help" is.