There are errors in the following code. Find any 6 errors. All errors are typos or spelling
Fantastic news! We've Found the answer you've been seeking!
Question:
There are errors in the following code. Find any 6 errors. All errors are typos or spelling errors. Copy the table below into the text box. Identify the line number of the error and write the line number under the 'Line' column and write the corrected syntax in the right under the column 'Corrected Code'.
Transcribed Image Text:
1 function Get-Monitor{ 2 3 4 5 5.0 6 7 8 9 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 [cmdletbinding()] Param( ] } [Parameter(Mandatory-$True,Position=0] [string[]]$ComputerName Begin {} } Process { Foreach($Computer in ComputerName){ If(Test-Connection -CompterName $Computer-Count 1-Quiet){ Try{ } $Monitors = get-wmiobiect -ComputerName $Computer-ClassName wmimonitorid -Namespace root/wmi-ErrorAction Stop Foreach($Monitor in $Monitors){ $Model = [System.Text.Encoding]::ASCII.GetString($Monitor.UserFriendlyName) $SerialNumber = [System.Text.Encoding]::ASCII.GetString($Monitor.SerialNumberID) New-Object -TypeName PSCustomObject -Property @{ ComputerName = $Computer Model = $Model SerialNumber = $SerialNumber End{}l } } Catch{ Write-Warning -Message "Cannot query WMIMonitorID WMI class on $Computer. $($_.Exception. Message) } } Else{ } Write-Warning -Message "Connection to remote server $Computer failed." 1 function Get-Monitor{ 2 3 4 5 5.0 6 7 8 9 10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 [cmdletbinding()] Param( ] } [Parameter(Mandatory-$True,Position=0] [string[]]$ComputerName Begin {} } Process { Foreach($Computer in ComputerName){ If(Test-Connection -CompterName $Computer-Count 1-Quiet){ Try{ } $Monitors = get-wmiobiect -ComputerName $Computer-ClassName wmimonitorid -Namespace root/wmi-ErrorAction Stop Foreach($Monitor in $Monitors){ $Model = [System.Text.Encoding]::ASCII.GetString($Monitor.UserFriendlyName) $SerialNumber = [System.Text.Encoding]::ASCII.GetString($Monitor.SerialNumberID) New-Object -TypeName PSCustomObject -Property @{ ComputerName = $Computer Model = $Model SerialNumber = $SerialNumber End{}l } } Catch{ Write-Warning -Message "Cannot query WMIMonitorID WMI class on $Computer. $($_.Exception. Message) } } Else{ } Write-Warning -Message "Connection to remote server $Computer failed."
Expert Answer:
Answer rating: 100% (QA)
Here are the identified errors in the provided code Line Corrected Code 4 Par... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Problem 6: Rubber Band Redux The potential energy of a rubber band of relaxed length L when it is stretched to a length may be shown to be l U -k = 1 k ( 1 - 31 + 21 ). (3.60) where k is a constant....
-
Explain how to apply the rules of Section (61)a to determine taxable items.
-
Calculate turn for each month below: express answer three places to the right of the decimal. Feb March April May June July Aug BOM $44,511 $46,750 $42,689 $42,985 $47,843 $48,000 46,603 Sales...
-
F udy A big part of communication is sharing personal information with another person. Some information we believe we have the right to be our own and should remain private. However, the degree to...
-
The energies of the 4s, 4p, and 4d states of potassium are given in Example 41.8. Calculate Z eff for each state. What trend do your results show? How can you explain this trend?
-
The number of lightning strikes on a square kilometer of open ground in a year has mean 6 and standard deviation 2.4. The National Lightning Detection Network (NLDN) uses automatic sensors to watch...
-
Consider the life expectancy data given in Table B.16. Create an indicator variable for gender. Perform a thorough analysis of the overall average life expectancy. Discuss the results of this...
-
The accountant of Cornett Chocolates Ltd., Maria Fraulein, has been advised by her auditors that the companys investment in Concertinas Milk Ltd. should be accounted for using the equity method of...
-
How do ethical leaders navigate ethical gray areas and moral ambiguity in rapidly evolving business landscapes, exercising moral courage and ethical reflexivity to confront ethical challenges,...
-
Grandfoods, Inc., makes energy supplement bars for use by athletes and others who need an energy boost. One of the critical quality characteristics is the weight of the bars. Too much weight implies...
-
Now list any aspects of each type of business that you might find objectionable. Would you, for instance, find it unpleasant to be solely responsible for all legal obligations in a sole...
-
Discuss the rediscovery of the victim. How far should victims have rights in the criminal justice process? Can these conflict with the offenders' rights?
-
Paul Grant, a 40-year-old resident of Florida, was referred by his regular physician in Florida to Dr. Michael Galloway at his specialty clinic in Atlanta, Georgia. Dr. Galloway recommended surgery...
-
Go to three of the e-discovery websites in the "Internet Sites" and compare and contrast the services of the vendors. Which one would you use? Why?
-
Why do you think states have laws requiring that contracting parties have capacity to enter into a contract? Do you these laws are beneficial? Do you know anyone who has been unable to enter into a...
-
You are the facility services director for a small, but important, nonprofit organization that helps protect and relocate spouses who are the victims of abuse. Wanting to make an improvement to its...
-
classify the species given below by the intermolecular forcespresent in a pure sample of each: Ar H2 HCN HF BrCl5 NH3 CH3OH H2S PF5 CH2Cl2 are they dispersion, dipole-dipole, or h bond?
-
For the following exercises, rewrite the sum as a product of two functions or the product as a sum of two functions. Give your answer in terms of sines and cosines. Then evaluate the final answer...
-
Leslie and Leon Lazo are married and file a joint return for 2012. Leslie's Social Security number is 466-47-3311 and Leon's is 467-74-4451. They live at 143 Snapdragon Drive, Reno, NV 82102. For...
-
If Charles, a 16-year-old child model, earns $50,000 a year and is completely self supporting even though he lives with his parents, can his parents claim him as a dependent? Why or why not?...
-
Linda and Richard are married and file a joint return for 2012. During the year, Linda, who works as an accountant for a national airline, used $2,100 worth of free passes for travel on the airline;...
-
Which of the following function(s) is/are carried out by piRITS or piRISC? a. Inhibits transcription of TEs b. Causes the degradation of TE RNA c. Causes chromosome breakage d. Both a and b are...
-
Scientists propose that the first macromolecules in protobionts were a. DNA molecules. b. RNA molecules. c. proteins. d. all of the above.
-
In the CRISPR-Cas system, what does tracrRNA bind to? a. crRNA and Cas1 protein b. crRNA and Cas2 protein c. crRNA and Cas9 protein d. Cas1 and Cas2 proteins
Study smarter with the SolutionInn App