packer-community / winrmcp

Copy files to a remote host using WinRM
MIT License
58 stars 31 forks source link

checks to ensure file exists #29

Closed diegogoding closed 6 years ago

diegogoding commented 6 years ago

@dylanmei In previous versions of windows or PowerShell Remove-Item %s -ErrorAction SilentlyContinue is perfectly fine, I can build Windows Images 2012 R2 with this perfectly fine.

With Windows 2016 this behavior is different. It's now throwing an error and breaking the build.

I created an issue issues/5752 And I've confirmed this fix works and no longer breaks Windows 2016 builds.

I have a few lines of the log messages in the issue. I'm happy to supply you with more.

diegogoding commented 6 years ago

There should be nothing wrong with Remove-Item %s -ErrorAction SilentlyContinue like how it is written. For some reason Windows 2016 does not like it. I am able to build with packer 1.1.0, the release prior to this PR. I even switched the code back to the code prior to PR 27 and compiled packer form source, and it builds Windows 2016, then switch it back to the code with PR 27 and compile packer, and it breaks the Windows 2016 build.

I am open for other ideas...

dylanmei commented 6 years ago

@diegogoding Thanks for updating the PR. I think this is fine.