It is simply the best/simplest solution and trying to prevent users from passing and integer here would be like opening a can of worms. Because:
* we cannot make mapstructure validate our duration string ( with an UnmarshalJSON func etc.)
* we cannot make mapstructure spit a string instead of a duration and packer will decode-encode-decode config.
* the hcl2 generated code asks for a string, so this will be enforced by default.
Before this commit it was possible to set a duration using an integer or a float. Go's time.Duration is an int64 internally an mapstructure will take advantage of this and load the number as a int64 but `1` means one ns which is unexpected/confusing. To avoid confusion and enforce readability this forces users to pass a string with a unit for a duration; ex "56s".
revert so we can use a branch that's had more recent work done
This reverts commit e56849c6056220b8dd555f841f7e0a5028b25af0, reversing
changes made to 6d14eb6ea4ffa5cbaa0bad9d62d2dff09f946b15.
Revert so that we can merge a different branch that's had more recent work instead
This reverts commit ba518637d49380955f4bd2f0e6009888037fa82e, reversing
changes made to e56849c6056220b8dd555f841f7e0a5028b25af0.
Fix a bug in the size of string that was returned when decoding a base64 string
Added tests around encoding and decoding powershell scripts. Used [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes('powershell commands')) | clip to generate what base 64 strings should look like
Fix unit tests for not showing progress stream when using powershell
Ensure that progress stream does not get leaked into stdout
Using Write-Output instead of Write-Host since PS v5 now leaks the host stream to stderr