I just installed the plugin today (v1.2) and my job did not fail even though the Powershell errored:
Started by user anonymous
[EnvInject] - Loading node environment variables.
Building on master in workspace C:\SPE\Jenkins\jobs\Test1\workspace
[EnvInject] - Injecting environment variables from a build step.
[EnvInject] - Injecting as environment variables the properties file path 'C:/SPE/Jenkins/DailyBuild/buildtime.properties'
[EnvInject] - Variables injected successfully.
[workspace] $ cmd /c call C:\Users\SPESER~1\AppData\Local\Temp\hudson868747164412287880.bat
C:\SPE\Jenkins\jobs\Test1\workspace>rem echo BUILDTIME=1027 > C:\SPE\Jenkins\DailyBuild\buildtime.properties
C:\SPE\Jenkins\jobs\Test1\workspace>exit 0
[workspace] $ powershell.exe "& 'C:\Users\SPESER~1\AppData\Local\Temp\hudson7972185748419603015.ps1'"
out-file : Could not find a part of the path 'C:\SPE\Jenkins\jobs\Test1\workspace%SE_R_MASTER%\buildtime.properties'.
At C:\Users\speservice\AppData\Local\Temp\hudson7972185748419603015.ps1:2 char:1
+ Write-Output "BUILDTIME=$time" > %SE_R_MASTER%\buildtime.properties
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (
[Out-File], DirectoryNotFoundException
+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand
Finished: SUCCESS
I don't like being locked in to being path relative to workspace (the windows batch command doesn't do this). Yes, I have already adjusted my path, but my primary issue is having the false positive. That makes it unusable in a production environment.
The plugin build with these changes, in case anyone dares to run plugins from an untrusted source.