I'm trying to use Power Shell 'Set-Alias' command to make an alias to a complex command with arguments. It doesn't work for anything but simple single commands (for which no alias is needed!). E.g., an alias to 'ls' works, but even one to 'ls *' does not.
PS C:\Users\snyde\BFROOT> Set-Alias
cmdlet Set-Alias at command pipeline position 1 Supply values for the following parameters: Name: tdir Value: ls * PS C:\Users\snyde\BFROOT> tdir tdir : The term 'ls *' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1
- tdir
-
+ CategoryInfo : ObjectNotFound: (ls *:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\snyde\BFROOT> Set-Alias
cmdlet Set-Alias at command pipeline position 1 Supply values for the following parameters: Name: tdir Value: ls * PS C:\Users\snyde\BFROOT> tdir tdir : The term 'ls *' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1
- tdir
-
+ CategoryInfo : ObjectNotFound: (ls *:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
I expect 'tt' to execute 'ls *'