cancel
Showing results for 
Search instead for 
Did you mean: 

Powershell started via blueprism does not load installed packages

AndersChristens
Level 2

I am launching PowerShell via blueprism and need to change the expiration date on some users. I have the packages installed on the machine and can run the code if I open PowerShell outside of the blueprism environment.

Blueprism start location is "C:\Program Files\Blue Prism Limited\Blue Prism Automate" Local PowerShell starts in network drive "G:" where the packages are installed.

I have tried to change the location, but it does not help. Elevated permission is not the problem and I have checked that the code works.

This is the error message: Set-ADAccountExpiration : The 'Set-ADAccountExpiration' command was found in the module 'ActiveDirectoryModule', but the module could not be loaded.

3 REPLIES 3

John__Carter
Staff
Staff
Hi Anders - when you say 'launching PowerShell' do you mean you are using Application Manager to start powershell.exe? If you search this forum you'll find discussions on executing powershell via code stages rather than via the VBO launcher. There's also an example of this on the DX you can try.

AndersChristens
Level 2
@John Carter
Sorry I didn't clarify that in the original post, but yes, I'm trying to launch via Application manager. The reason I'm doing it this way is that I couldn't get it to work via the code stage post. The problem was that I could not get it to save and use variables, but if I could copy/paste it into a PowerShell prompt I could make it work.

ewilson
Staff
Staff
Hi @Anders Christensen,

FWIW - Here's an example of passing parameters into a PowerShell script using the Utility - PowerShell VBO that @John Carter referenced. I have a very simple PowerShell script that simply echoes whatever input message has been supplied using the -message parameter. Then it executes the standard Get-CimInstance command. All of the output is then captured and returned as output via the VBO.

If I wanted to pass in multiple parameters, I would need to make use the Delimiter input parameter to specify what custom delimiter I was using to separate my input data. So I might use the pipe character ( | ) which would look something like this with multiple parameters: -message "This is a test" | -priority 3 | ...

Hopefully that helps a bit.​

34879.png
34880.png
34881.png
34882.png
34883.png
34884.png
​Cheers,
Eric