Skip to content

Dev/script analyzer fixes #29

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 3 commits into from
Feb 1, 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
2 changes: 1 addition & 1 deletion UnitySetup/UnitySetup.psd1
Original file line number Diff line number Diff line change
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 = @("UnitySetupInit.ps1")
ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()
Expand Down
30 changes: 28 additions & 2 deletions UnitySetup/UnitySetup.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@
# Licensed under the MIT License.
Import-Module powershell-yaml -Force -ErrorAction Stop

[Flags()]
enum UnitySetupComponentType
{
Setup = (1 -shl 0)
Documentation = (1 -shl 1)
StandardAssets = (1 -shl 2)
ExampleProject = (1 -shl 3)
Metro = (1 -shl 4)
UWP_IL2CPP = (1 -shl 5)
Android = (1 -shl 6)
iOS = (1 -shl 7)
AppleTV = (1 -shl 8)
Facebook = (1 -shl 9)
Linux = (1 -shl 10)
Mac = (1 -shl 11)
Vuforia = (1 -shl 12)
WebGL = (1 -shl 13)
Windows_IL2CPP = (1 -shl 14)
All = (-1)
}

class UnitySetupInstaller
{
[UnitySetupComponentType] $ComponentType
Expand Down Expand Up @@ -228,6 +249,7 @@ function Find-UnitySetupInstaller
function Install-UnitySetupInstance
{
[CmdletBinding()]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost', '', Scope='Function')]
param(
[parameter(ValueFromPipeline=$true)]
[UnitySetupInstaller[]] $Installers,
Expand Down Expand Up @@ -496,7 +518,7 @@ function Get-UnityProjectInstance
#>
function Start-UnityEditor
{
[CmdletBinding(DefaultParameterSetName="Context")]
[CmdletBinding(SupportsShouldProcess, DefaultParameterSetName="Context")]
param(
[parameter(Mandatory=$false, ValueFromPipeline = $true, ParameterSetName='Projects')]
[parameter(Mandatory=$true, ValueFromPipeline = $true, ParameterSetName='ProjectsLatest')]
Expand Down Expand Up @@ -665,7 +687,11 @@ function Start-UnityEditor
$setProcessArgs['ArgumentList'] = $unityArgs
}

Write-Verbose "Starting $editor $unityArgs"
if(-not $PSCmdlet.ShouldProcess("$editor $unityArgs", "Start-Process"))
{
continue
}

$process = Start-Process @setProcessArgs
if( $Wait )
{
Expand Down
19 changes: 0 additions & 19 deletions UnitySetup/UnitySetupInit.ps1

This file was deleted.