You do not need Start-Process to run one PowerShell script from another PowerShell script. Just call the second script with any parameters you want:
# script1.ps1 $loc = Read-Host 'Enter location' C:\path\to\script2.ps1 $loc 'other parameter'
In the second script, a list of arguments can be obtained, for example, through the $args array:
# script2.ps1 Write-Host $args[0] Write-Host $args[1]
You can also define named parameters as follows:
# script2.ps1 Param($Location, $Foo) Write-Host $Location Write-Host $Foo
or (more complete):
# script2.ps1 [CmdletBinding()] Param( [Parameter(Mandatory=$true)] [string]$Location, [Parameter(Mandatory=$false)] [string]$Foo ) Write-Host $Location Write-Host $Foo
Defining named parameters allows you to pass arguments without worrying about their order:
C:\path\to\script2.ps1 -Foo 'other parameter' -Location $loc
or automatically have parameters checked without having to perform checks in the function body:
# script2.ps1 Param( [ValidateSet('a', 'b', 'c')] [string]$Location, [ValidatePattern('^[az]+$')] [string]$Foo ) Write-Host $Location Write-Host $Foo
If more arguments are passed than named parameters are defined, additional arguments are stored in the $args array:
PS C: \> cat test.ps1
Param ($ Foo)
Write-Host $ Foo
Write-Host $ args [0]
PS C: \> . \ Test.ps1 'foo' 'bar'
foo
bar
For more information, see Get-Help about_Functions_Advanced_Parameters .