Hi Peter Groenewegen (@pgroene), we ran into the 65k file limitation of [System.IO.Path]::GetTempFileName() in our CD environment. As documented here, temporary files need to be pruned if GetTempFileName() is going to be used to generate file names.
To avoid the 65k file limitation issue, I'm proposing we replace [System.IO.Path]::GetTempFileName().Replace(".tmp",".ps1") with Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath "$([System.Guid]::NewGuid().Guid).ps1" and also deleting the ps1 file after invocation. If you're ok with this proposal, I can submit a PR. I cloned your repo here: https://github.com/tristanbarcelon/Vsts-Build-Task-InlinePowershell and it contains the proposed changes.
Thank you.
Hi Peter Groenewegen (@pgroene), we ran into the 65k file limitation of
[System.IO.Path]::GetTempFileName()in our CD environment. As documented here, temporary files need to be pruned if GetTempFileName() is going to be used to generate file names.To avoid the 65k file limitation issue, I'm proposing we replace
[System.IO.Path]::GetTempFileName().Replace(".tmp",".ps1")withJoin-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath "$([System.Guid]::NewGuid().Guid).ps1"and also deleting the ps1 file after invocation. If you're ok with this proposal, I can submit a PR. I cloned your repo here: https://github.com/tristanbarcelon/Vsts-Build-Task-InlinePowershell and it contains the proposed changes.Thank you.