|
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
Launch Powershell script with specific parameters from Visual Build
Hello
I need to launch Powershell script with specific parameters from Visual Build.In Input section of the powershell step if i write the parameters as values (File1,File2,File3) everything works ok.But if I want to provide just some parameters and use option "Provide standard input from a string" there is no parameters passed,they remained with empty values.I want to specify into the Powershell step just some parameters and others to remain with default values.See the bld file attached with step1 working ok (all params are passed) and step2 where no param is passed from the input string. |
#2
|
|||
|
|||
Standard input is a way to pipe content into the called program, not pass parameters to it per se.
https://www.tutorialspoint.com/batch...iles_pipes.htm https://kinook.com/VisBuildPro/Manua...llinputtab.htm One option would be to pass the arguments by naming them and then assigning to a hash table in PowerShell. See attached. |
#3
|
|||
|
|||
Thanks a lot!Could you please attach the bld file for version 9?I tried to open it bit it says it was created in a newer version so it cannot be open.
|
#4
|
|||
|
|||
I downloaded free version of VBP10 and was able to open the sample attached.Powershell script is developed by other person ,I should not change it,Would be great if you have a sample showing how to pass params from standard input using pipe command (if possibile somehow).Or any otther option not implying the change of the powershell script.
|
#5
|
|||
|
|||
I don't know if there is a way to call a PowerShell script like that, passing only the 1st and 3rd parameter. You can pass just the 1st, or the 1st and 2nd, or the 1st, 2nd, and 3rd, but not the 1st and 3rd. If there is, you can just call PowerShell.exe or pwsh.exe as needed from a Run Program action.
|
#6
|
|||
|
|||
Ok,in that case I will use Run Program step instead of Powershell step.Thanks!
|
Tags |
powershell |
|
|