Skip to content

Commit 0e5c47a

Browse files
authored
Merge pull request #13 from jwittner/dev/unityInstalls
Support for Installs, big Start-UnityEditor update
2 parents e505274 + 6948be7 commit 0e5c47a

File tree

4 files changed

+639
-195
lines changed

4 files changed

+639
-195
lines changed

README.md

Lines changed: 75 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,100 @@ The `master` branch is automatically built and deployed to the [PowerShell Galle
1111
## Installation
1212

1313
```powershell
14-
PS C:\> Install-Module UnitySetup -Scope CurrentUser
14+
Install-Module UnitySetup -Scope CurrentUser
1515
```
1616

1717
## Using
1818

1919
Find all of your Unity installs:
2020
```powershell
21-
PS C:\> Get-UnitySetupInstance
22-
23-
InstallationVersion InstallationPath
24-
------------------- ----------------
25-
2017.2.1f1 C:\Program Files\Unity-2017.2.1f1\Editor\
26-
2017.1.0p5 C:\Program Files\Unity.2017.1.0p5\Editor\
27-
2017.1.1f1 C:\Program Files\Unity.2017.1.1f1\Editor\
28-
2017.1.1p3 C:\Program Files\Unity.2017.1.1p3\Editor\
29-
2017.2.0f3 C:\Program Files\Unity.2017.2.0f3\Editor\
30-
2017.3.0f3 C:\Program Files\Unity.2017.3.0f3\Editor\
31-
5.5.4p3 C:\Program Files (x86)\Unity.5.5.4p3\Editor\
21+
Get-UnitySetupInstance
22+
23+
# Example output:
24+
# InstallationVersion InstallationPath
25+
# ------------------- ----------------
26+
# 2017.2.1f1 C:\Program Files\Unity-2017.2.1f1\Editor\
27+
# 2017.1.0p5 C:\Program Files\Unity.2017.1.0p5\Editor\
28+
# 2017.1.1f1 C:\Program Files\Unity.2017.1.1f1\Editor\
29+
# 2017.1.1p3 C:\Program Files\Unity.2017.1.1p3\Editor\
30+
# 2017.2.0f3 C:\Program Files\Unity.2017.2.0f3\Editor\
31+
# 2017.3.0f3 C:\Program Files\Unity.2017.3.0f3\Editor\
32+
# 5.5.4p3 C:\Program Files (x86)\Unity.5.5.4p3\Editor\
3233
```
3334

3435
Select the Unity installs that you want:
3536
```powershell
36-
PS C:\> Get-UnitySetupInstance | Select-UnitySetupInstance -Latest
37-
PS C:\> Get-UnitySetupInstance | Select-UnitySetupInstance -Version '2017.1.1f1'
38-
PS C:\> Get-UnitySetupInstance | Select-UnitySetupInstance -Project '.\MyUnityProject'
37+
Get-UnitySetupInstance | Select-UnitySetupInstance -Latest
38+
Get-UnitySetupInstance | Select-UnitySetupInstance -Version '2017.1.1f1'
39+
Get-UnitySetupInstance | Select-UnitySetupInstance -Project '.\MyUnityProject'
3940
```
4041

42+
Find all the Unity projects recursively:
43+
```powershell
44+
Get-UnityProjectInstance -Recurse
45+
46+
# Example output:
47+
# ProjectPath UnityInstanceVersion
48+
# ----------- --------------------
49+
# C:\Projects\Project1\OneUnity\ 2017.2.0f3
50+
# C:\Projects\Project1\TwoUnity\ 2017.3.0f3
51+
# C:\Projects\Project2\ 2017.1.1p1
52+
# C:\Projects\Project3\App.Unity\ 2017.1.2f1
53+
```
4154
Launch the right Unity editor for a project:
4255
```powershell
43-
PS C:\MyUnityProject> Start-UnityEditor
44-
PS C:\> Start-UnityEditor -Project .\MyUnityProject
56+
Start-UnityEditor
57+
Start-UnityEditor -Project .\MyUnityProject
58+
Start-UnityEditor -Project .\MyUnityProject -Latest
59+
Start-UnityEditor -Project .\MyUnityProject -Version '2017.3.0f3'
60+
```
61+
Launch many projects at the same time:
62+
```powershell
63+
Get-UnityProjectInstance -Recurse | Start-UnityEditor
64+
```
65+
Find the installers for a particular version:
66+
```powershell
67+
Find-UnitySetupInstaller -Version '2017.3.0f3' | Format-Table
68+
69+
# Example output:
70+
# ComponentType Version Length LastModified DownloadUrl
71+
# ------------- ------- ------ ------------ -----------
72+
# Setup 2017.3.0f3 553688024 2017-12-18 08:15:20 https://netstorage.unity3d.com/unity/...
73+
# Documentation 2017.3.0f3 358911256 2017-12-18 08:18:37 https://netstorage.unity3d.com/unity/...
74+
# StandardAssets 2017.3.0f3 189886032 2017-12-18 08:15:52 https://netstorage.unity3d.com/unity/...
75+
# ExampleProject 2017.3.0f3 258824680 2017-12-18 08:15:39 https://netstorage.unity3d.com/unity/...
76+
# Metro 2017.3.0f3 172298008 2017-12-18 08:17:44 https://netstorage.unity3d.com/unity/...
77+
# UWP_IL2CPP 2017.3.0f3 152933480 2017-12-18 08:17:55 https://netstorage.unity3d.com/unity/...
78+
# Android 2017.3.0f3 194240888 2017-12-18 08:16:06 https://netstorage.unity3d.com/unity/...
79+
# iOS 2017.3.0f3 802853872 2017-12-18 08:17:21 https://netstorage.unity3d.com/unity/...
80+
# AppleTV 2017.3.0f3 273433528 2017-12-18 08:16:24 https://netstorage.unity3d.com/unity/...
81+
# Facebook 2017.3.0f3 32131560 2017-12-18 08:16:27 https://netstorage.unity3d.com/unity/...
82+
# Linux 2017.3.0f3 122271984 2017-12-18 08:17:30 https://netstorage.unity3d.com/unity/...
83+
# Vuforia 2017.3.0f3 65677296 2017-12-18 08:18:00 https://netstorage.unity3d.com/unity/...
84+
# WebGL 2017.3.0f3 134133288 2017-12-18 08:18:09 https://netstorage.unity3d.com/unity/...
4585
```
4686

47-
Find all the Unity projects recursively
87+
Limit what components you search for:
4888
```powershell
49-
PS C:\Projects> Get-UnityProjectInstance -Recurse
50-
51-
ProjectPath UnityInstanceVersion
52-
----------- --------------------
53-
C:\Projects\Project1\OneUnity\ 2017.2.0f3
54-
C:\Projects\Project1\TwoUnity\ 2017.3.0f3
55-
C:\Projects\Project2\ 2017.1.1p1
56-
C:\Projects\Project3\App.Unity\ 2017.1.2f1
89+
Find-UnitySetupInstaller -Version 2017.3.0f3 -Components 'Setup','Documentation' | Format-Table
90+
91+
# Example output:
92+
# ComponentType Version Length LastModified DownloadUrl
93+
# ------------- ------- ------ ------------ -----------
94+
# Setup 2017.3.0f3 553688024 2017-12-18 08:15:20 https://netstorage.unity3d.com/unity/...
95+
# Documentation 2017.3.0f3 358911256 2017-12-18 08:18:37 https://netstorage.unity3d.com/unity/...
96+
```
97+
98+
Install UnitySetup instances:
99+
```powershell
100+
# Pipeline is supported, but downloads, then installs, then downloads, etc.
101+
Find-UnitySetupInstaller -Version '2017.3.0f3' | Install-UnitySetupInstance
102+
103+
# This will issue all downloads together, then install each.
104+
Install-UnitySetupInstance -Installers (Find-UnitySetupInstaller -Version '2017.3.0f3')
57105
```
58106

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

UnitySetup/UnitySetup.psd1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
RootModule = 'UnitySetup'
1515

1616
# Version number of this module.
17-
ModuleVersion = '1.5'
17+
ModuleVersion = '2.0'
1818

1919
# Supported PSEditions
2020
# CompatiblePSEditions = @()
@@ -61,7 +61,7 @@ RequiredModules = @(
6161
# RequiredAssemblies = @()
6262

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

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

7575
# 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.
76-
FunctionsToExport = 'Get-UnitySetupInstance', 'Select-UnitySetupInstance', 'Start-UnityEditor', 'Get-UnityProjectInstance'
76+
FunctionsToExport = '*'
7777

7878
# 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.
79-
CmdletsToExport = 'Get-UnitySetupInstance', 'Select-UnitySetupInstance', 'Start-UnityEditor', 'Get-UnityProjectInstance'
79+
CmdletsToExport = '*'
8080

8181
# Variables to export from this module
8282
# VariablesToExport = @()

0 commit comments

Comments
 (0)