title: PowerShell script with input parameters with packer(.json)
body: <p>I have this Ps1 script,</p>
  
  <pre><code>param   ([string] $userpassword, [string] $UserName)
  
  Write-host "Start.." (Get-date)
  
  Write-host "User Name is "$UserName Write-host "User password is
  "$userpassword
  
  if ($userpassword.length -lt 0) {
      Write-host "Please enter password!"$UserName }
  
  Write-host "End.." (Get-date)
  </code></pre>
  
  <p>packer(.json) as follows:</p>
  
  <pre><code>"provisioners":    [
      {
        "type": "powershell",
        "environment_vars": 
        [
          "userpassword=********",
          "UserName=ABC"
        ],      
        "scripts": 
        [
          "test.ps1"
        ]
      } ]
  </code></pre>
  
  <p>.Ps1 can not read input para from packer(.json)...</p>