I have a function (function1) that requires sta mode. I would like to activate this function from poshconsole in non sta mode. This works when I have function1 in my profile
$command = "function1 'MyArguments'" powershell -sta -command $command
But how can I do this when I have function1 not in the profile and I call
powershell -sta -noprofile -command $command
Is it possible to execute several commands with calling powershell.exe? Or can I pass customprofilepath?
source share