I want to get result of Test-Path(or ultimately be able to run any command) on a list of computers that was returned from another query but I get wrong info for my return
this is my code
$AD_list = (Get-ADComputer -Filter *).Name
$py_path = "C:Python39"
Invoke-Command -ArgumentList ($AD_list) -ScriptBlock {
foreach ($machine in $AD_list) {
Test-Path $py_path
} }
Have tried passing $AD_list as $args[0] or declare it as a positional parameter param([System.Collections.ArrayList]$AD_list) but didn’t work
I appreciate any clues or feedback.