This is my jenkins script. Without pipeline, can see ls result list. but when include pipeline with foreach, assign null to '$_'. Why??
stage('Module Build'){
gitlabCommitStatus('Module Build'){
powershell "${pythonPath} -m compileall ${srcPath}"
powershell "ls ${srcPath}\\*.py -Recurse | foreach {rm $_}"
}
}
error log
d:\...\durable-51664e76\powershellScript.ps1:1 char:33
+ ls src\*.py -Recurse | foreach {rm "null"}
+ ~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (D:\Jenkins\work...istributor\nu
ll:String) [Remove-Item], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.Remov
eItemCommand