-
-
Save jdmonty/9fe816d1a1f9aa24e996 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
: make-alias.cmd | |
if "%1" == "" goto usage: | |
for /F "usebackq" %%v in (`"powershell $M = ipmo -PassThru "%1" ; $M.ExportedCommands.Keys"`) do doskey %%v=powershell ipmo "%1" ; %%v $* | |
echo Aliases: | |
doskey /macros | |
goto done | |
:usage | |
echo Usage: | |
echo. | |
echo make-alias PSMODULE | |
echo. | |
echo. | |
echo PSMODULE should either be a path to a module (psm1 or psd1) | |
echo or a powershell module name | |
echo. | |
echo eg: make-alias c:\path\to\oneget.psd1 | |
echo. | |
echo. | |
:done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment