Skip to content

ForrestTrepte/unitysetup.powershell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity Setup Powershell Module

This PowerShell module contains tools for managing and automating your Unity installs and projects.

Builds

Master

Build status

The master branch is automatically built and deployed to the PowerShell Gallery.

Develop

Build status

The develop branch is automatically built and deployed as a prerelease module to the PowerShell Gallery.

Installation

Install-Module UnitySetup -Scope CurrentUser

Using

Cmdlets

Find all of your Unity installs:

Get-UnitySetupInstance

# Example output:
# Version                                        Components Path
# -------                                        ---------- ----
# 2017.1.2f1                       Setup, Metro, UWP_IL2CPP C:\Program Files\Unity-2017.1.2f1\
# 2017.1.3f1                       Setup, Metro, UWP_IL2CPP C:\Program Files\Unity-2017.1.3f1\
# 2017.2.1f1                       Setup, Metro, UWP_IL2CPP C:\Program Files\Unity-2017.2.1f1\
# 2017.3.1f1       Setup, Metro, UWP_IL2CPP, Linux, Vuforia C:\Program Files\Unity-2017.3.1f1\
# 2018.1.0b4              Setup, Metro, UWP_IL2CPP, Vuforia C:\Program Files\Unity-2018.1.0b4\
# 2018.1.0b8                                            All C:\Program Files\Unity-2018.1.0b8\
# 2017.1.0p5                       Setup, Metro, UWP_IL2CPP C:\Program Files\Unity.2017.1.0p5\
# 2017.1.1f1                       Setup, Metro, UWP_IL2CPP C:\Program Files\Unity.2017.1.1f1\
# 2017.1.1p3       Setup, StandardAssets, Metro, UWP_IL2CPP C:\Program Files\Unity.2017.1.1p3\
# 2017.2.0f3              Setup, Metro, UWP_IL2CPP, Vuforia C:\Program Files\Unity.2017.2.0f3\
# 2017.3.0f3         Setup, Metro, UWP_IL2CPP, Mac, Vuforia C:\Program Files\Unity.2017.3.0f3\

Select the Unity installs that you want:

Get-UnitySetupInstance | Select-UnitySetupInstance -Latest
Get-UnitySetupInstance | Select-UnitySetupInstance -Version '2017.1.1f1'
Get-UnitySetupInstance | Select-UnitySetupInstance -Project '.\MyUnityProject'

Find all the Unity projects recursively:

Get-UnityProjectInstance -Recurse

# Example output:
# Version    Path
# -------    ----
# 2017.2.0f3 C:\Projects\Project1\OneUnity\                 
# 2017.3.0f3 C:\Projects\Project1\TwoUnity\                 
# 2017.1.1p1 C:\Projects\Project2\                          
# 2017.1.2f1 C:\Projects\Project3\App.Unity\                

Launch the right Unity editor for a project:

Start-UnityEditor
Start-UnityEditor -Project .\MyUnityProject
Start-UnityEditor -Project .\MyUnityProject -Latest
Start-UnityEditor -Project .\MyUnityProject -Version '2017.3.0f3'

Launch many projects at the same time:

Get-UnityProjectInstance -Recurse | Start-UnityEditor

Find the installers for a particular version:

Find-UnitySetupInstaller -Version '2017.3.0f3' | Format-Table

# Example output:
# ComponentType Version       Length LastModified        DownloadUrl
#  ------------- -------       ------ ------------        -----------
#          Setup 2017.3.0f3 553688024 2017-12-18 08:15:20 https://netstorage.unity3d.com/unity/...
#  Documentation 2017.3.0f3 358911256 2017-12-18 08:18:37 https://netstorage.unity3d.com/unity/...
# StandardAssets 2017.3.0f3 189886032 2017-12-18 08:15:52 https://netstorage.unity3d.com/unity/...
#          Metro 2017.3.0f3 172298008 2017-12-18 08:17:44 https://netstorage.unity3d.com/unity/...
#     UWP_IL2CPP 2017.3.0f3 152933480 2017-12-18 08:17:55 https://netstorage.unity3d.com/unity/...
#        Android 2017.3.0f3 194240888 2017-12-18 08:16:06 https://netstorage.unity3d.com/unity/...
#            iOS 2017.3.0f3 802853872 2017-12-18 08:17:21 https://netstorage.unity3d.com/unity/...
#        AppleTV 2017.3.0f3 273433528 2017-12-18 08:16:24 https://netstorage.unity3d.com/unity/...
#       Facebook 2017.3.0f3  32131560 2017-12-18 08:16:27 https://netstorage.unity3d.com/unity/...
#          Linux 2017.3.0f3 122271984 2017-12-18 08:17:30 https://netstorage.unity3d.com/unity/...
#        Vuforia 2017.3.0f3  65677296 2017-12-18 08:18:00 https://netstorage.unity3d.com/unity/...
#          WebGL 2017.3.0f3 134133288 2017-12-18 08:18:09 https://netstorage.unity3d.com/unity/...

Limit what components you search for:

Find-UnitySetupInstaller -Version 2017.3.0f3 -Components 'Setup','Documentation' | Format-Table

# Example output:
# ComponentType Version       Length LastModified        DownloadUrl
#  ------------- -------       ------ ------------        -----------
#          Setup 2017.3.0f3 553688024 2017-12-18 08:15:20 https://netstorage.unity3d.com/unity/...
#  Documentation 2017.3.0f3 358911256 2017-12-18 08:18:37 https://netstorage.unity3d.com/unity/...

Install UnitySetup instances:

# Pipeline is supported, but downloads, then installs, then downloads, etc.
Find-UnitySetupInstaller -Version '2017.3.0f3' | Install-UnitySetupInstance

# This will issue all downloads together, then install each.
Install-UnitySetupInstance -Installers (Find-UnitySetupInstaller -Version '2017.3.0f3')

DSC

UnitySetup includes the xUnitySetupInstance DSC Resource. An example configuration might look like:

<#
    Install multiple versions of Unity and several components
#>
Configuration Sample_xUnitySetupInstance_Install {

    Import-DscResource -ModuleName UnitySetup

    Node 'localhost' {

        xUnitySetupInstance Unity {
            Versions = '2017.3.1f1,2018.1.0b9'
            Components = 'Setup', 'Mac', 'Linux', 'Metro', 'iOS'
            Ensure = 'Present'
        }
    }
}

See more by perusing the UnitySetup\Examples folder.

Feedback

To file issues or suggestions, please use the Issues page for this project on GitHub.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Powershell module for interfacing with Unity installs and projects.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PowerShell 100.0%