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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started