I have some aliases that are defined in MS Dos style, how can I invoke those from Powershell? When I type "alias" from Powershell prompt, I can see my aliases defined there but when I try to call them by just typing their names, Powershell complains with a message like "The term 'whatever' is not recognized as the name of a cmdlet...".
Asked
Active
Viewed 1,304 times
1
-
Please add an example. – pk. Jun 05 '12 at 20:40
-
1@pk I believe these are aliases set up via `doskey`. Example: http://superuser.com/questions/49170/create-an-alias-in-windows-xp – sysadmin1138 Jun 05 '12 at 20:46
1 Answers
1
From Getting doskey macros to work in PowerShell:
PS> doskey /exename=powershell.exe cd\home=pushd $env:USERPROFILE\$*
and
PS> doskey /exename=powershell.exe /MACROFILE=mymacros.txt
See that page for more information.

Dennis Williamson
- 62,149
- 16
- 116
- 151
-
I've read that article. This one doesn't seem to work for me. I.e., after running `doskey /exename=powershell.exe cd\home=pushd $env:USERPROFILE\$*` in PowerShell, if I type `cd\home` I get an error `cd\home : The module 'cd' could not be loaded.` – KFL Sep 04 '15 at 23:04