Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] Third Party Tools

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 03-07-2023, 05:33 PM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
I have one more issue,if param MyParam2 contains { I got an error at step Run Test PowerShell script-with parameters :

3/8/2023 12:26:39 AM: Building project step 2 - Run Test PowerShell script-with parameters...
C:\Windows\System32\WindowsPowerShell\v1.0\powersh ell.exe -nologo -noninteractive -executionpolicy Unrestricted "& 'C:\Program Files\VisBuildPro9\Test.ps1' Test1 Test{2[]??"
Missing closing '}' in statement block or type definition.
+ CategoryInfo : ParserError: ( : ) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingEndCurlyBrace

This is because the powershell script is launched with parameters without enclosing ' '

For example if I launch the script from a batch file step by adding enclosing ' ' all is ok:
3/8/2023 12:30:42 AM: Building project step 3 - Run PowerShell script from batch step...
C:\Windows\System32\WindowsPowerShell\v1.0\powersh ell.exe -nologo -noninteractive -executionpolicy Unrestricted "& 'C:\Program Files\VisBuildPro9\Test.ps1' -Param1 'Test1' -Param2 'Test{2[]??'
Param1= Test1
Param2= Test{2[]??

Is there a way to add enclosing ' ' when using a Powershell step?
I attached the bld project.
Attached Files
File Type: bld TestPowershell2.bld (1.4 KB, 481 views)
Reply With Quote
 

Tags
powershell , special charcaters

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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:26 AM.


Copyright © 1999-2023 Kinook Software, Inc.