Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
BuildMaster v2023 PSEVAL
-
Hi Support,
Given this Otterscript;Set-BuildVariable Web ( Value: $PSEval("(Get-Website -Name MyWebSite).PhysicalPath") );
This correctly sets the Variable;
After upgrading to BuildMaster v2023; it seems this is broken with the Variable output being;
Also the engine syntax highlighting is not happy with the brackets;
BuildMaster 7, the text in quotes is picked including the brackets is highlighted in green;
Vs BuildMaster 2023, the syntax highlight is not correctly following the brackets within the quotes, i.e. the middle bracket is white..
Thanks,
Paul
-
Hi @paul_6112,
I'm not able to reproduce this; I tried something similar, a script that looks just like this:
Set-BuildVariable MyVar ( Value: $PSEval("(Get-TimeZone).Id") );
There's a lot of moving parts in the case you gave, so best to use something simpler to try to repro. Like
Get-TimeZone
. It'd be good if you "play around" and figure out what specifically is causing the behavior.Cheers,
Alana
-
Hi Alana,
Using IIS was the simplest repro I could come up with for you to easily replicate, sorry..I can confirm that something as basic as Get-Date does work;
$PSEval(Get-Date)This is a 'raw' powershell example output;
We did try adding ' | out-string' to force any formatting for PSEval but this didn't make a difference.
I've tried your example and tried to come up with something else you should have by default (although you will have to change the InterfaceAlias to whatever yours is called..
Raw PowerShell Output;
BuildMaster 2023 Script;
Build Output;
So why does your example want to return a String (?) and my example want to return a List (?)
Thanks,
Paul
-
Hi @paul_6112 ,
That's really peculiar; what must be happening is that PowerShell is returning multiple results, so the variable is automatically being being created as a list:
https://github.com/Inedo/inedox-scripting/blob/master/Scripting/InedoExtension/Functions/PsEvalVariableFunction.cs#L52Digging further, it's like related to some issue with value detection/conversion:
https://github.com/Inedo/inedox-scripting/blob/master/Scripting/InedoExtension/PowerShell/PSUtil.cs#L205Unfortunately it's a bit of rabbit hole from here; it's just as likely a bug in .NET6 powershell libraries as it is our code. But hopefully you can play around and find a work around? I'm at a loss, and we're pretty heads-down in ProGet 2024 planning at the moment, so hard to find the likely half-a-day to explore this further.
I'll add this to our BuildMaster 2024 roadmap, but if anyone else experiences this (or we get a ticket) we'll investigate it further.
Cheers,
Alana