Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Debug the following script to run properly in PowerShell #BuggyScript2.ps1 written by Kevin Azevedo on 1/12/15 #A script to debug #Initialization #Initializing variables $computer =

Debug the following script to run properly in PowerShell

#BuggyScript2.ps1 written by Kevin Azevedo on 1/12/15 #A script to debug

#Initialization #Initializing variables

$computer = "DC1", "W8-Client"; "W7-Client" $num_computers = 3 $querys = "Select * from Win32_ComputerSystem", "Select * from Win32_LogicalDisk", "Select * from Win32_Process where name like '*svc*'"

Functions

#Main Loop

for ($i=1, $i < $num_computers; $i++) { foreach ( $query in $querys) { $session = New-CimSession -ComputerName $computers[$i] Get-CimInstance -CimSession $session -Query $query }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions

Question

7. It is advisable to do favors for people whenever possible.

Answered: 1 week ago

Question

9. Power and politics can be destructive forces in organizations.

Answered: 1 week ago