-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array in scriptbloc #202
Comments
The vars $tableaux is not aware in the threads (runspaces). |
it's not easy when it's the first time with powershell ! aha ^^ Thanks for this ! ( the code on plain text if someone want to copy )
|
glad to see this works for you, please close the issue if it is resolved. |
Hello,
I am a student in DUT Networks and telecommunication and also a beginner in powershell. (FR : DUT / UK : DHE / US : AD )
After a few hours of searching the Internet, I would like to display the different tables in the RSJob.
i have this return on my terminal, someone can guide me ? :)
( the code on plain text if someone want to edit )
$ADCheck=@(Get-ADComputer -filter "*" -Properties IPv4address -SearchBase "OU=COMPUTERS,DC=test,DC=local" |Where-Object {$_.ipv4address} | Select-Object -ExpandProperty ipv4address ) $TableauEchP=@() $TableauRPES=@() $TableauRPRS=@() $ADCheck | Start-RSJob -Name {$_} -Throttle $env:NUMBER_OF_PROCESSORS -ScriptBlock { param($ip)[string] if(Test-Connection -Count 1 -ComputerName $ip -Quiet) { try { if(Get-Service -Name test) { $TableauRPRS += $ip } else { $TableauRPES += $ip } } catch{} } else { $TableauEchP += $ip } } Get-RSJob | Wait-RSJob Write-Host "//////////////////////////////////////////////////////////////////////////////////////////////////" Write-Host "This is IP as all test on TRUE" $TableauRPRS Write-Host "//////////////////////////////////////////////////////////////////////////////////////////////////" Write-Host "Ping : TRUE - Service : FALSE" $TableauRPES Write-Host "//////////////////////////////////////////////////////////////////////////////////////////////////" Write-Host "Ping : FALSE, check computer if is up" $TableauEchP Write-Host "//////////////////////////////////////////////////////////////////////////////////////////////////"
The text was updated successfully, but these errors were encountered: