Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam MD-100 topic 3 question 84 discussion

Actual exam question from Microsoft's MD-100
Question #: 84
Topic #: 3
[All MD-100 Questions]

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have a computer that runs Windows 10. The computer contains a folder named D:\Scripts. D:\Scripts contains several PowerShell scripts.
You need to ensure that you can run the PowerShell scripts without specifying the full path to the scripts. The solution must persist between PowerShell sessions.
Solution: From System Properties, you add D:\Scripts to the PATH environment variable.
Does this meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
b3arb0yb1m
Highly Voted 3 years ago
A - Yes. I don't see why not.
upvoted 16 times
KirilA
2 years, 11 months ago
I just tested it and it works.
upvoted 3 times
...
...
Ediddy
Highly Voted 3 years ago
Seems like it would be A to me as well. Wrong answer?
upvoted 9 times
AVP_Riga
3 years ago
Yes, seems wrong.
upvoted 3 times
...
...
golijat
Most Recent 1 year, 1 month ago
Chat-GPT says Answer A is correct. Adding the folder containing the PowerShell scripts to the PATH environment variable will allow you to run the scripts from any location in the PowerShell console without specifying the full path to the scripts. This solution will persist between PowerShell sessions, meaning that you won't need to add the folder to the PATH variable every time you start a new PowerShell session. To add the D:\Scripts folder to the PATH environment variable, follow these steps: Right-click the Start menu and select System. Click Advanced system settings. Click Environment Variables. Under System Variables, scroll down and select Path, and then click Edit. Click New and enter the path to the D:\Scripts folder, then click OK. Click OK to close all the windows. After completing these steps, you should be able to run the PowerShell scripts in the D:\Scripts folder without specifying the full path to the scripts.
upvoted 1 times
...
ExamTopics1_EIS
1 year, 1 month ago
Selected Answer: A
Yes. Period.
upvoted 1 times
...
ChrisC21
1 year, 1 month ago
Selected Answer: A
The correct answer is 'A'. Environment variables don't just disappear between PowerShell sessions and server as fixed points of reference for the windows environment (i.e. environment variables).
upvoted 1 times
...
williamlamata
1 year, 2 months ago
chatgpt: A. Yes, this meets the goal. Explanation: The PATH environment variable is a system variable that contains a list of directories where the operating system looks for executable files. By adding D:\Scripts to the PATH environment variable, you can run PowerShell scripts in that directory without specifying the full path to the scripts.
upvoted 2 times
...
Hatsapatsa
1 year, 4 months ago
Selected Answer: A
Tested with windows sysinternal tools and IT IS persistent.
upvoted 1 times
...
Miunih
1 year, 5 months ago
This site has so many answers just straight up wrong, I'm wondering if anyone actually reviews them
upvoted 2 times
golijat
1 year, 1 month ago
Of course NOT
upvoted 1 times
...
...
Thomas4k
1 year, 6 months ago
im more confushed than before in most of these tasks. People dosent agree and often doent agree with the provided answer. Its terrible way of studying
upvoted 2 times
...
Kock
1 year, 7 months ago
Resposta: A To make a persistent change to an environment variable on Windows using the System Control Panel: Open the System Control Panel. Select System. Select Advanced System Settings. Go to the Advanced tab. Select Environment Variables.... Make your chang https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-7.2&viewFallbackFrom=powershell-6
upvoted 1 times
...
JosB
2 years ago
Selected Answer: A
answer is A. tested and even after reboot it works
upvoted 1 times
...
Epion
2 years ago
Selected Answer: A
This is the standard way to change the path under Windows manually. It permanently modifies the path, so it will persist between Powershell sessions as well.
upvoted 1 times
...
ABIT1337
2 years, 1 month ago
Selected Answer: A
Saving changes to environment variables To make a persistent change to an environment variable on Windows, use the System Control Panel. Select Advanced System Settings. On the Advanced tab, click Environment Variable.... You can add or edit existing environment variables in the User and System (Machine) scopes. Windows writes these values to the Registry so that they persist across sessions and system restarts. Alternately, you can add or change environment variables in your PowerShell profile. This method works for any version of PowerShell on any supported platform. https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-7.2&viewFallbackFrom=powershell-6
upvoted 1 times
...
Tommo
2 years, 1 month ago
Selected Answer: B
B is correct.
upvoted 2 times
Blobbyguts
11 months, 3 weeks ago
Agreed To run a PowerShell script you need to use the -File switch and include the full path to the .ps1 file; the PATH variable is not checked apart from locating the path the the PowerShell executable itself.
upvoted 1 times
...
...
Appychou
2 years, 2 months ago
The answer is B as: When you change environment variables in PowerShell, the change affects only the current session...Read more here https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-7.1#saving-changes-to-environment-variables
upvoted 1 times
ShakDaddy
2 years, 1 month ago
The question does not state adding variables via powershell
upvoted 2 times
...
neobahamutk
2 years, 1 month ago
You are contradicting yourself. According to the link you sent the correct answer is A. "To make a persistent change to an environment variable on Windows, use the System Control Panel. Select Advanced System Settings. On the Advanced tab, click Environment Variable.... You can add or edit existing environment variables in the User and System (Machine) scopes. Windows writes these values to the Registry so that they persist across sessions and system restarts."
upvoted 1 times
...
...
Mr_Fielding
2 years, 5 months ago
Selected Answer: A
This link seems to support 'A' as the correct answer: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-7.1#saving-changes-to-environment-variables
upvoted 2 times
...
jaroti2116
2 years, 5 months ago
you still need to add path every time .better answer will be right-click and run poershell here
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...