piccus
piccus

Reputation: 171

Powershell shortcut on desktop: Chain two commands

I'm trying to create a shortcut on the desktop:

%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -noexit -command import-module \\fs\PS\MyModule\MyModule.dll

That is working. Furthermore I want to read all commands of that module, after opening PS automatically. How do I append the following:

get-commands -Module MyModule

Thx piccus

Upvotes: 0

Views: 955

Answers (1)

Esperento57
Esperento57

Reputation: 17492

try somesthing like this

powershell.exe -noexit -command "& { import-module \\fs\PS\MyModule\MyModule.dll; ... others command ...}"

Upvotes: 2

Related Questions