Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select-UnitySetupInstance : Readme indicates a non-existant 'Project' parameter and description of 'Path' parameter doesn't match functionality. #194

Open
kobechenyang opened this issue Sep 27, 2019 · 5 comments

Comments

@kobechenyang
Copy link

When calling
Start-UnityEditor -Project .\build-machine-setup
I am getting this error:

Start-UnityEditor : Cannot process argument transformation on parameter 'Project'. 
Cannot convert value ".\build-machine-setup" to type "UnityProjectInstance[]". Error:     
"Cannot convert value ".\build-machine-setup" to type "UnityProjectInstance". Error:      
"Exception calling "Load" with "1" argument(s): "(Line: 1, Col: 1, Idx: 0) - (Line: 1, 
Col: 2, Idx: 1): While scanning for the next token, find character that cannot start any  
token."""
At line:1 char:28
+ Start-UnityEditor -Project .\build-machine-setup
+                            ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Start-UnityEditor], ParameterBindingArgu  
   mentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Start-UnityEditor  

Any idea what is happening ?

@jwittner
Copy link
Member

jwittner commented Sep 27, 2019

Interesting. Looking at the constructor for UnityProjectInstance,, my guess is that it's failing to parse either ProjectSettings\ProjectVersion.txt or ProjectSettings\ProjectSettings.asset.

Does your Unity project have it's Asset Serialization Mode set as 'Force Text'? Text assets are expected by UnitySetup.

If that isn't the issue, would you mind taking a snip of your folder hierarchy and dropping your copies of the above two files into the issue?

@kobechenyang
Copy link
Author

kobechenyang commented Sep 27, 2019

Thanks for your answer ! But it didn't fix the problem. My project is empty unity project. But it was created with different version. I don't know if that matters. Also I notice when I call
Select-UnitySetupInstance -Project '.\build-machine-setup'
Also getting an error

At line:1 char:27
+ Select-UnitySetupInstance -Project 'C:\Users\kobec\build-machine-setu ...
+                           ~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Select-UnitySetupInstance], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Select-UnitySetupInstance```

@jwittner
Copy link
Member

jwittner commented Sep 28, 2019

Select-UnitySetupInstance doesn't have a Project parameter so that error makes sense. That cmdlet is for filtering the results of Get-UnitySetupInstance which finds installs of Unity on your machine. Highly recommend reading the README and running help <command>, e.g. help Select-UnitySetupInstance to learn more about the API.

Get-UnityProjectInstance -Recurse will find unity projects recursively under a folder. If .\build-machine-setup is the root of a Unity project it should find it, detect the version, and print out the details. Start-UnityEditor -Project <path to project> will either launch the right version of Unity or complain that it can't find it (it uses the *-UnitySetupInstance cmdlets for this).

Can you post your ProjectSettings\ProjectVersion.txt and ProjectSettings\ProjectSettings.asset? These are the only files relied upon by UnitySetup and if it's a clean Unity project shouldn't have any private information in it. With those I should be able to reproduce your issue and give further guidance.

@kobechenyang
Copy link
Author

kobechenyang commented Sep 28, 2019

You are right, Get-UnitySetupInstance doesn't have a project parameter. After I did Get-UnityProjectInstance -Recurse I was able to do a Start-UnityEditor -Project <path to project>. This Get-UnitySetupInstance | Select-UnitySetupInstance -Project '.\MyUnityProject' command inside README file is outdated then. Thanks. Can you modified README file?

@jwittner jwittner changed the title Start-UnityEditor : Cannot process argument transformation on parameter 'Project'. Select-UnitySetupInstance : Readme indicates a non-existant 'Project' parameter and description of 'Path' parameter doesn't match functionality. Sep 30, 2019
@jwittner
Copy link
Member

Reopening under new title to capture these doc issues.

@jwittner jwittner reopened this Sep 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants