Kinook Software Forum

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

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-20-2015, 10:41 AM
dorrellg dorrellg is online now
Registered User
 
Join Date: 02-06-2013
Posts: 2
Logging PowerShell action script

When using the PowerShell command within VBP, if you enter a script, when it is executed, VBP creates a tmp.ps1 file. Is there anyway to get this temp PS1 file? We'd like to keep a record of exactly how the PS code looks when it is executes. It also helps for debugging and troubleshooting processes.

In the example output below, you can see that all we have is that a tmp PS1 file was executed. There could've been 50 commands in the file, and we'd like to see what they are. Can we redirect input/output of the PS1 file?

Any help would be greatly appreciated.

Example Output:
11/20/2015 3:23:16 PM: Building project step 'Check-Create container if it does not exist'...
C:\Windows\System32\WindowsPowerShell\v1.0\powersh ell.exe -nologo -noninteractive -executionpolicy Unrestricted "& C:\Users\a212314650\AppData\Local\Temp\VisF783.tmp .ps1"

NOTE: I am using V8.6
Reply With Quote
  #2  
Old 11-20-2015, 11:04 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
The Script field of the PowerShell script is stored in the CmdStr step property, which is the default property for that action, so if you have Tools | Application Options | Logging | Log default property of each step checked, it will be logged when the step is built.

http://www.kinook.com/VisBuildPro/Manual/loggingopt.htm

Otherwise, you could log it yourself in the vbld_StepStarted script event like so:

Builder.LogMessage "PowerShell command = " & vbld_StepProp("CmdStr", vbString)

http://www.kinook.com/VisBuildPro/Ma...riptevents.htm
Reply With Quote
  #3  
Old 11-20-2015, 02:28 PM
dorrellg dorrellg is online now
Registered User
 
Join Date: 02-06-2013
Posts: 2
Option #2 worked perfect, thank you!

Option #1 worked half way, as it would cutoff the output half way and end with a "..."

Thank you so much for the help!!
Reply With Quote
  #4  
Old 11-20-2015, 11:19 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
In the latest build (VisBuildSvr.dll 9.2.0.1), it now defaults to a max of 5000 rather than 500 characters for the default property length to log, which also can now be overridden via the MaxDefaultPropertyLogLength application option in the object model (a value of 0 will not truncate).
Reply With Quote
Reply


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 04:28 AM.


Copyright © 1999-2023 Kinook Software, Inc.