Get The Scoop On What's New
Want to know what Plugins4Automate is doing for ConnectWise Automate? Come check out our blog and find out about new products and updates that we are working on! https://www.plugins4labtech.com/blogs/blog

More Powershell Errors

Post Reply
SamOrlando
Posts: 12
Joined: Wed May 01, 2019 2:55 pm

More Powershell Errors

Post by SamOrlando » Thu Jun 06, 2019 6:44 pm

Getting a Powershell error:

The Script(6319) was successful in the Then section.

Script: S6319 - Starting at Server Time: Thursday, June 06, 2019 1:12:19 PM
IF F1 T: 1.417
L1 F129 Jump (P1): :WEARESERVER T: 1.417
L3 F139 Note (P1): :WEARESERVER T: 1.417
L4 F109 Delimiter (P2): Variable (P3): PoShVersion T: 1.417
L5 F70 Value (P1): PoShVersion Comparer (P2): 6 To (P3): 2 Jump (P4): :EXECUTE T: 19.42
L6 F29 Message (P1): System doe not meet the minium requirments of Powershell 3 T: 19.42
L7 F129 Jump (P1): T: 19.421

However, this is running against a Server 2012 R2 server which has PoSh 4 and .NET 4.5 already installed. So what is it doing that it thinks the server doesn't have PoSh 3?

SamOrlando
Posts: 12
Joined: Wed May 01, 2019 2:55 pm

Re: More Powershell Errors

Post by SamOrlando » Thu Jun 06, 2019 6:51 pm

Fixed an environment variable that did not include Powershell and allowed me to run the PoSh line check manually and returned 4.

>powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -command $PSVersionTable.PSVersion.Major
>4


However, when running the script again, the result shows it returned 1.264.

The Script(6319) was successful in the Then section.

Script: S6319 - Starting at Server Time: Thursday, June 06, 2019 1:52:30 PM
IF F1 T: 1.263
L1 F129 Jump (P1): :WEARESERVER T: 1.264
L3 F139 Note (P1): :WEARESERVER T: 1.264
L4 F109 Delimiter (P2): Variable (P3): PoShVersion T: 1.264
L5 F70 Value (P1): PoShVersion Comparer (P2): 6 To (P3): 2 Jump (P4): :EXECUTE T: 9.266
L6 F29 Message (P1): System doe not meet the minium requirments of Powershell 3 T: 9.266
L7 F129 Jump (P1): T: 9.267


I ran it again, the the PoSh version continues to go lower, like it is being devided by some value:

The Script(6319) was successful in the Then section.

Script: S6319 - Starting at Server Time: Thursday, June 06, 2019 2:03:23 PM
IF F1 T: 0.049
L1 F129 Jump (P1): :WEARESERVER T: 0.05
L3 F139 Note (P1): :WEARESERVER T: 0.05
L4 F109 Delimiter (P2): Variable (P3): PoShVersion T: 0.05
L5 F70 Value (P1): PoShVersion Comparer (P2): 6 To (P3): 2 Jump (P4): :EXECUTE T: 6.57
L6 F29 Message (P1): System doe not meet the minium requirments of Powershell 3 T: 6.57
L7 F129 Jump (P1): T: 6.571


Tried adding a variable set command to zero out the PoShVersion variable at the top of the WEARESERVER function.

Still getting strange values returned:

The Script(6319) was successful in the Then section.

Script: S6319 - Starting at Server Time: Thursday, June 06, 2019 3:29:14 PM
IF F1 T: 0.457
L1 F129 Jump (P1): :WEARESERVER T: 0.457
L3 F139 Note (P1): :WEARESERVER T: 0.458
L4 F20 SetType(P1):1 Parameter(P2):0 VariableName(P3):PoShVersion T: 0.458
L5 F109 Delimiter (P2): Variable (P3): PoShVersion T: 0.458
L6 F70 Value (P1): PoShVersion Comparer (P2): 6 To (P3): 2 Jump (P4): :EXECUTE T: 8.464
L7 F29 Message (P1): System doe not meet the minium requirments of Powershell 3 T: 8.464
L8 F129 Jump (P1): T: 8.465


If I manually enter the Powershell on the DC, I get the proper result as mentioned at the top of this mess.

>powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -command $PSVersionTable.PSVersion.Major
>4

So what is happening with the PoShVersion variable that it is getting calculated and changed?

Last run and it is a value of 1.191.

User avatar
Cubert
Posts: 1185
Joined: Tue Dec 29, 2015 7:57 pm
Contact:

Re: More Powershell Errors

Post by Cubert » Thu Jun 13, 2019 1:24 pm

Mind blown!!


Not sure how a single powershell command that calls for a fixed value and the LabTech testing that value to be => 3 does not compute how it gets a decimal value that is ever changing?

Not sure where to start with this one.

Hmmm.....

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests