Hi,
I am getting an error while trying to run a powershell cmdlet from a custom imported module using staf utility. If I start the powershell from command line and run same command without staf it is working fine, I get the desired output. This is the command with problem:
Note: If I am using Powershell default modules from Microsoft using staf utility then everything is fine.
So my question is: It is something special that should be set up in Staf.cfg file in order to run successful a cmdlet imported from a custom module. So far I've updated the PsModulePath variable with the path to dll file, but it didn't work.
Any help related to this will be appreciated.
Thanks,
Nicolae Radulet
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am getting an error while trying to run a powershell cmdlet from a custom imported module using staf utility. If I start the powershell from command line and run same command without staf it is working fine, I get the desired output. This is the command with problem:
staf local process start shell "powershell -c %c" command "ipmo 'C:\Program Files\Tivoli\FlashcopyManager\FmModuleExc.dll';Get-DpExcConfig | out-file -FilePath C:\file.txt" wait returnstderr returnstdout workdir "C:\Program Files\Tivoli\flashcopymanager" sameconsole
Response
{
Return Code: 1
Key : <None>
Files :
{
Return Code: 0
Data :
}
{
Return Code: 0
Data : Get-DpExcConfig : Could not load file or assembly 'DpExcEngine,
Version=1.0.5373.15360, Culture=neutral, PublicKeyToken=null' or one of its
dependencies. The system cannot find the file specified.At line:1 char:65
+ ipmo 'C:\Program Files\Tivoli\FlashcopyManager\FmModuleExc.dll';Get-DpExcConfig ...
+
~~~~~~~~~~~~~~~
+ CategoryInfo : ReadError: (:) [Get-DpExcConfig, FileNotFoundEx
ception
+ FullyQualifiedErrorId : Get-DpExcConfig,IBM.Tivoli.TSM.Cmdlets.Exchange.
GetDpExcConfig
]
}
If I run this command then everything is ok
powershell -command "& {ipmo 'C:\Program Files\Tivoli\FlashcopyManager\FmModuleExc.dll';Get-DpExcConfig | out-file -FilePath C:\file.txt}"
Note: If I am using Powershell default modules from Microsoft using staf utility then everything is fine.
So my question is: It is something special that should be set up in Staf.cfg file in order to run successful a cmdlet imported from a custom module. So far I've updated the PsModulePath variable with the path to dll file, but it didn't work.
Any help related to this will be appreciated.
Thanks,
Nicolae Radulet