Closed samalavi closed 8 years ago
It seems your username has a . in the name. I'll investigate how I can fix the code to ignore the .
I resleased a new version, the bug should be fixed now, can you verify?
Awesome. This is fixed in new version. Now we are getting a real temp file.
2016-08-24T00:17:02.9529595Z ##[command]& 'C:\Users\svc.tfsbuild\AppData\Local\Temp\tmp7650.ps1'
Thanks heaps Peter.
Based on task implementation, it should obtain a temp file every time getting executed on the agent machine, but looks like it's not happening in my environment. I'm using this task on a TFS 2015.U2 and looks like task does not obtain a temp file for dumping the script block and always uses 'C:\Users\svc.ps1' as the target script file on the agent. Issue arises when it even doesn't purge/delete this file every time task getting executed and appends the script block to this file which causes problems in actual execution.
The other odd thing is I've deployed version 1.1.1 which is the latest one, but log says it's deployed on the agent in an older folder and running the main script from this folder.
Here is the execution log:
2016-08-16T05:52:29.3462182Z C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". ([scriptblock]::Create('if (!$PSHOME) { $null = Get-Item -LiteralPath ''variable:PSHOME'' } else { Import-Module -Name ([System.IO.Path]::Combine($PSHOME, ''Modules\Microsoft.PowerShell.Management\Microsoft.PowerShell.Management.psd1'')) ; Import-Module -Name ([System.IO.Path]::Combine($PSHOME, ''Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1'')) }')) 2>&1 | ForEach-Object { Write-Verbose $_.Exception.Message -Verbose } ; $env:TF_BUILD = 'True' ; Import-Module -Name 'D:\TFS Build vNext Agent\vNextAgent7\tasks\InlinePowershell\1.1.0\ps_modules\VstsTaskSdk\VstsTaskSdk.psd1' -ArgumentList @{ NonInteractive = $true } -ErrorAction Stop ; $VerbosePreference = 'Continue' ; $DebugPreference = 'Continue' ; Invoke-VstsTaskScript -ScriptBlock ([scriptblock]::Create('. ''D:\TFS Build vNext Agent\vNextAgent7\tasks\InlinePowershell\1.1.0\InlinePowershell.ps1'''))" 2016-08-16T05:52:33.8775943Z ##[debug]VstsTaskSdk 0.6.2 commit b4160c33da0010bd83279e9ffa9bbf13bcbd1ce2 2016-08-16T05:52:34.9244990Z ##[debug]Entering D:\TFS Build vNext Agent\vNextAgent7\tasks\InlinePowershell\1.1.0\InlinePowershell.ps1. ... 2016-08-16T05:52:36.3620386Z ##[debug]Env:INPUT_SCRIPTARGUMENTS (empty) 2016-08-16T05:52:36.9089260Z ##[command]& 'C:\Users\svc.ps1' ...