microsoft / unitysetup.powershell

Powershell module for interfacing with Unity installs and projects.
MIT License
179 stars 48 forks source link

How-to get full, unabreviated paths #234

Closed falldeaf closed 2 years ago

falldeaf commented 2 years ago

If I run: "Get-UnityProjectInstance -Recurse", I get a successful listing of my projects, but if any of the project names of filepaths are too long, they get abbreviated with a "...". If they get abreviated I'm unable to scrape the results and get a listing that I can use. I'm trying to get the full path and name so that I can write a keylauncher plugin to list Unity projects and launch them.

falldeaf commented 2 years ago

I did some more reading and was able to figure out that unitysetup.powershell commands are not returning text, but powershell objects, so they can easily be converted to another format if necessary.

For instance, to get a list of projects in JSON format, you can use the ConvertTo-Json cmdlet, like this:

Get-UnityProjectInstance -Recurse | ConvertTo-Json