Parsing Errors

Post Reply
User avatar
starbucksgold
Posts: 26
Joined: Tue Jan 05, 2016 7:53 pm
8

Parsing Errors

Post by starbucksgold »

Shannon,

I have some basic PS scripts that work in PS but when executed through the plugin fails.

Script:
$app = gwmi -Class win32_product | Where-Object {$_.Name -eq "ZixM*"}
$app.Uninstall()

Via Plugin produces the following:

Executing -> $app = gwmi -Class win32_product | Where-Object {$_.Name -eq `"ZixM*"`}

$app.Uninstall()

<#><#><#>You must provide a value expression on the right-hand side of the '-eq' operato
r.
At line:1 char:61
+ $app = gwmi -Class win32_product | Where-Object {$_.Name -eq <<<< `ZixM*`}
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordEx
ception
+ FullyQualifiedErrorId : ExpectedValueExpression


Ideas on how to resolve?

Thanks.

Jeff

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

Re: Parsing Errors

Post by Cubert »

Yeap, simply add a ( ; ) between commands

like so...

Code: Select all

$app = gwmi -Class win32_product | Where-Object {$_.Name -eq "ZixM*"};$app.Uninstall()

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

Re: Parsing Errors

Post by Cubert »

Jeff,
Your gonna like this!!!

Save scrips in script manager!!
Capture33.PNG
Capture33.PNG (47.51 KiB) Viewed 16562 times
Execute scripts at the PC Console
Capture333.PNG
Capture333.PNG (52.13 KiB) Viewed 16562 times

Oh how yummy!! :ugeek:

User avatar
starbucksgold
Posts: 26
Joined: Tue Jan 05, 2016 7:53 pm
8

Re: Parsing Errors

Post by starbucksgold »

You are right...I like this. :D

Thanks.

Jeff

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

Re: Parsing Errors

Post by Cubert »

need to add a prams passer to the script executer.. thats next..

Post Reply

Return to “PowerShell plugin for Labtech”