Passing variables as arguments in powershell script

In your Start-Job you need to specify your arguments:

param($directory)
start-job -Name $directory -scriptblock {dir $directory > C:$directory.txt} -argumentlist $directory

Take a look at: Passing variables as arguments in powershell script

Also when you post code could you format it as code: Posting Guide