Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] Third Party Tools
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-09-2020, 02:29 PM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
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.
Attached Files
File Type: bld TestPowershell.bld (1.9 KB, 5708 views)
Reply With Quote
  #2  
Old 09-09-2020, 08:57 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
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.
Attached Files
File Type: bld TestPowershell.bld (2.8 KB, 5212 views)
Reply With Quote
  #3  
Old 09-10-2020, 04:43 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
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.
Reply With Quote
  #4  
Old 09-10-2020, 05:04 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
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.
Reply With Quote
  #5  
Old 09-10-2020, 09:57 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
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.
Reply With Quote
  #6  
Old 09-11-2020, 04:17 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
Ok,in that case I will use Run Program step instead of Powershell step.Thanks!
Reply With Quote
Reply

Tags
powershell


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 07:11 AM.


Copyright © 1999-2023 Kinook Software, Inc.