Powershell calling Powershell script
You get another PowerShell process in the former case and the script cannot read variables defined in your current session:
PS> $foo = 'bar'PS> 'Write-Host $foo'|Set-Content x.ps1PS> & powershell .\x.ps1PS> & .\x.ps1bar