Skip to content

Support for Installs, big Start-UnityEditor update #13

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

Merged
merged 2 commits into from
Jan 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 75 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,51 +11,100 @@ The `master` branch is automatically built and deployed to the [PowerShell Galle
## Installation

```powershell
PS C:\> Install-Module UnitySetup -Scope CurrentUser
Install-Module UnitySetup -Scope CurrentUser
```

## Using

Find all of your Unity installs:
```powershell
PS C:\> Get-UnitySetupInstance

InstallationVersion InstallationPath
------------------- ----------------
2017.2.1f1 C:\Program Files\Unity-2017.2.1f1\Editor\
2017.1.0p5 C:\Program Files\Unity.2017.1.0p5\Editor\
2017.1.1f1 C:\Program Files\Unity.2017.1.1f1\Editor\
2017.1.1p3 C:\Program Files\Unity.2017.1.1p3\Editor\
2017.2.0f3 C:\Program Files\Unity.2017.2.0f3\Editor\
2017.3.0f3 C:\Program Files\Unity.2017.3.0f3\Editor\
5.5.4p3 C:\Program Files (x86)\Unity.5.5.4p3\Editor\
Get-UnitySetupInstance

# Example output:
# InstallationVersion InstallationPath
# ------------------- ----------------
# 2017.2.1f1 C:\Program Files\Unity-2017.2.1f1\Editor\
# 2017.1.0p5 C:\Program Files\Unity.2017.1.0p5\Editor\
# 2017.1.1f1 C:\Program Files\Unity.2017.1.1f1\Editor\
# 2017.1.1p3 C:\Program Files\Unity.2017.1.1p3\Editor\
# 2017.2.0f3 C:\Program Files\Unity.2017.2.0f3\Editor\
# 2017.3.0f3 C:\Program Files\Unity.2017.3.0f3\Editor\
# 5.5.4p3 C:\Program Files (x86)\Unity.5.5.4p3\Editor\
```

Select the Unity installs that you want:
```powershell
PS C:\> Get-UnitySetupInstance | Select-UnitySetupInstance -Latest
PS C:\> Get-UnitySetupInstance | Select-UnitySetupInstance -Version '2017.1.1f1'
PS C:\> Get-UnitySetupInstance | Select-UnitySetupInstance -Project '.\MyUnityProject'
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:
```powershell
Get-UnityProjectInstance -Recurse

# Example output:
# ProjectPath UnityInstanceVersion
# ----------- --------------------
# C:\Projects\Project1\OneUnity\ 2017.2.0f3
# C:\Projects\Project1\TwoUnity\ 2017.3.0f3
# C:\Projects\Project2\ 2017.1.1p1
# C:\Projects\Project3\App.Unity\ 2017.1.2f1
```
Launch the right Unity editor for a project:
```powershell
PS C:\MyUnityProject> Start-UnityEditor
PS C:\> Start-UnityEditor -Project .\MyUnityProject
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:
```powershell
Get-UnityProjectInstance -Recurse | Start-UnityEditor
```
Find the installers for a particular version:
```powershell
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/...
# ExampleProject 2017.3.0f3 258824680 2017-12-18 08:15:39 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/...
```

Find all the Unity projects recursively
Limit what components you search for:
```powershell
PS C:\Projects> Get-UnityProjectInstance -Recurse

ProjectPath UnityInstanceVersion
----------- --------------------
C:\Projects\Project1\OneUnity\ 2017.2.0f3
C:\Projects\Project1\TwoUnity\ 2017.3.0f3
C:\Projects\Project2\ 2017.1.1p1
C:\Projects\Project3\App.Unity\ 2017.1.2f1
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:
```powershell
# 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')
```


# Feedback
To file issues or suggestions, please use the [Issues](https://github.com/Microsoft/unitysetup.powershell/issues) page for this project on GitHub.

Expand Down
8 changes: 4 additions & 4 deletions UnitySetup/UnitySetup.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
RootModule = 'UnitySetup'

# Version number of this module.
ModuleVersion = '1.5'
ModuleVersion = '2.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -61,7 +61,7 @@ RequiredModules = @(
# RequiredAssemblies = @()

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()
ScriptsToProcess = @("UnitySetupInit.ps1")

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()
Expand All @@ -73,10 +73,10 @@ RequiredModules = @(
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = 'Get-UnitySetupInstance', 'Select-UnitySetupInstance', 'Start-UnityEditor', 'Get-UnityProjectInstance'
FunctionsToExport = '*'

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = 'Get-UnitySetupInstance', 'Select-UnitySetupInstance', 'Start-UnityEditor', 'Get-UnityProjectInstance'
CmdletsToExport = '*'

# Variables to export from this module
# VariablesToExport = @()
Expand Down
Loading