The py -3 -m venv venv command works when typed manually into a Powershell terminal, but breaks when called from a ps1 script.
What specifically must be changed in the code below in order for the setup.ps1 script to successfully run the py -3 -m venv venv command when the setup.ps1 is called from outside using the Invoke-Command -FilePath setup.ps1 or a similar replacement command?
The contents of the setup.ps1 command are:
py -3 -m venv venv
The command that calls setup.ps1 including the error together look like:
PS C:\path\to\dir\containing_setup_py> Invoke-Command -FilePath setup.ps1
Invoke-Command : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Invoke-Command -FilePath setup.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-Command], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.InvokeCommandCommand
PS C:\path\to\dir\containing_setup_py>
Invoke-Command? Just do.\setup.ps1.\setup.ps1if you specifyshell: pwsh