Please check the parameter "-stderr, stdout" in the add-hpctask which represents the location for your standard output and error
Add-HpcTask [-CommandLine <String>] [-CustomProperties <String[]>] [-Depend <String[]>] [-End <Int32>] [-Env <Strin
g[]>] [-Exclusive <Boolean>] [-FailJobOnFailure <Boolean>] [-FailJobOnFailureCount <Int32>] [-Increment <Int32>] [-
Name <String>] [-NumCores <String>] [-NumNodes <String>] [-NumSockets <String>] [-Parametric] [-RequiredNodes <Stri
ng[]>] [-Rerunnable <Boolean>] [-RunTime <String>] [-Scheduler <String>] [-Start <Int32>] [-Stderr <String>] [-Stdi
n <String>] [-Stdout <String>] [-TaskFile <String>] [-Type {Basic | ParametricSweep | NodePrep | NodeRelease | Serv
ice}] [-ValidExitCodes <String>] [-WorkDir <String>] -Job <HpcJob> [<CommonParameters>]
Add-HpcTask [-CommandLine <String>] [-CustomProperties <String[]>] [-Depend <String[]>] [-End <Int32>] [-Env <Strin
g[]>] [-Exclusive <Boolean>] [-FailJobOnFailure <Boolean>] [-FailJobOnFailureCount <Int32>] [-Increment <Int32>] [-
Name <String>] [-NumCores <String>] [-NumNodes <String>] [-NumSockets <String>] [-Parametric] [-RequiredNodes <Stri
ng[]>] [-Rerunnable <Boolean>] [-RunTime <String>] [-Scheduler <String>] [-Start <Int32>] [-Stderr <String>] [-Stdi
n <String>] [-Stdout <String>] [-TaskFile <String>] [-Type {Basic | ParametricSweep | NodePrep | NodeRelease | Serv
ice}] [-ValidExitCodes <String>] [-WorkDir <String>] -JobId <Int32> [<CommonParameters>]
Qiufang Shi