Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI Exam 701-100 Topic 8 Question 42 Discussion

Actual exam question for LPI's 701-100 exam
Question #: 42
Topic #: 8
[All 701-100 Questions]

A declarative Jenkins pipeline contains the following excerpt:

parameters {

string (name: 'TargetEnvironment', defaultValue: 'staging', description: 'Target environment')

}

How can a task use the value provided for TargetEnvironment?

Show Suggested Answer Hide Answer
Suggested Answer: E

Contribute your Thoughts:

Virgina
1 months ago
Option E is clearly the answer - $ENV{TargetEnvironment} is the way to go, because everyone knows Jenkins pipelines are just glorified shell scripts, right? Right??
upvoted 0 times
Judy
8 days ago
B) $TargetEnvironment
upvoted 0 times
...
Louisa
16 days ago
A) {{TargetEnvironment}}
upvoted 0 times
...
...
Marguerita
1 months ago
I'm just going to go with D and hope the exam gods smile upon me. Though, I have to admit, option E with the $ENV{TargetEnvironment} looks like it could be from a Perl script. This exam is getting confusing!
upvoted 0 times
...
Ryan
1 months ago
Haha, option C with the %TargetEnvironment% looks like something from a Windows batch script. This is definitely a Jenkins pipeline, so D is the right answer.
upvoted 0 times
Carmelina
16 hours ago
I agree, D) ${params.TargetEnvironment} is the correct syntax to use the value provided for TargetEnvironment.
upvoted 0 times
...
Carolann
3 days ago
Yeah, using ${params.TargetEnvironment} is the standard way to access the value in a Jenkins pipeline.
upvoted 0 times
...
Leota
9 days ago
Option D) ${params.TargetEnvironment} is the correct way to use the value provided for TargetEnvironment.
upvoted 0 times
...
...
Deandrea
2 months ago
I was tempted to go with option B, but that's more of a shell variable syntax. The Jenkins pipeline syntax uses the params object, so D is the way to go.
upvoted 0 times
Joye
15 days ago
Good to know, thanks for clarifying!
upvoted 0 times
...
Kayleigh
18 days ago
Yes, you're right. The params object is used in Jenkins pipeline syntax.
upvoted 0 times
...
Leota
1 months ago
I think D) ${params.TargetEnvironment} is the correct way to access the value.
upvoted 0 times
...
...
Asuncion
2 months ago
I think option D is correct, as it uses the params object to access the TargetEnvironment parameter.
upvoted 0 times
Carry
19 hours ago
I agree, option D is the correct way to access the value of TargetEnvironment parameter.
upvoted 0 times
...
Deja
2 days ago
That's a good choice. It's important to correctly access the parameters in a declarative Jenkins pipeline.
upvoted 0 times
...
Louvenia
5 days ago
Thanks for confirming. I will make sure to use ${params.TargetEnvironment} in my tasks.
upvoted 0 times
...
Corrina
19 days ago
Yes, you are right. Option D is the correct way to use the value provided for TargetEnvironment.
upvoted 0 times
...
Theola
1 months ago
D) ${params.TargetEnvironment}
upvoted 0 times
...
Eileen
1 months ago
I believe option D is correct, it accesses the TargetEnvironment parameter using the params object.
upvoted 0 times
...
Tiera
1 months ago
A) {{TargetEnvironment}}
upvoted 0 times
...
...
Erinn
2 months ago
I'm not sure, but I think it might be E) $ENV{TargetEnvironment}
upvoted 0 times
...
Shawnee
2 months ago
I agree with Raina, D) ${params.TargetEnvironment} makes sense because it references the parameter value
upvoted 0 times
...
Raina
2 months ago
I think the correct answer is D) ${params.TargetEnvironment}
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77