title: Running a powershell script from another one. Test-path giving false
body: <p>I have a requirement to run a script with admin rights by users. So I created 2 scripts where a user runs the first script which will call the second script with start-process with admin credentials. I am passing currently logged in user ID and user profile from first script to second script as arguments to make use of them in the second script. However everything is fine but getting error when accessing user's documents folder in the second script using a variable to the path.</p>
  
  <p>First script as below.</p>
  
  <pre><code>    $currentusername = $env:USERNAME
      $currentuserprofile = $env:USERPROFILE
      $adminusername = "domain\admin"
      $adminPassword = 'pwd' | ConvertTo-SecureString -Force -AsPlainText
      $credential = New-Object 
      System.Management.Automation.PsCredential($adminusername, $adminPassword)
      $scriptpath = "path to second script.ps1"
      Start-Process -filepath PowerShell.exe -Credential $credential -argumentlist "-noexit", "-executionpolicy bypass","-file $scriptpath",$currentusername,$currentuserprofile
  </code></pre>
  
  <p>Second Script.ps1</p>
  
  <pre><code>    param (
      #$currentusername = $args[3],
      $currentuserprofile = $args[5]
      )
      $UserDir = "$currentuserprofile\Documents\"
      Test-Path $UserDir
  </code></pre>
  
  <p>this test-path $UserDir is giving false.
  Can anyone have had this issue or help me on to overcome this?</p>