Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!