I have to be missing something incredibly simple here. Here's a very basic script to illustrate what I'm trying:
$Computers = @('comp1', 'comp2')
$ScriptBlock = {
New-Item "C:\Temp\$C.txt" -Force
}
Foreach ($C in $Computers)
{
Start-Job -ScriptBlock $ScriptBlock -ArgumentList $C
}
The script runs, but $C is not passed, so i just get a ".txt" file in my folder. What simple thing am I overlooking here?