File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 1414RootModule = ' UnitySetup'
1515
1616# Version number of this module.
17- ModuleVersion = ' 2.0 '
17+ ModuleVersion = ' 2.1 '
1818
1919# Supported PSEditions
2020# CompatiblePSEditions = @()
Original file line number Diff line number Diff line change @@ -258,7 +258,11 @@ function Install-UnitySetupInstance
258258 [string ]$Destination ,
259259
260260 [parameter (Mandatory = $false )]
261- [string ]$Cache = [io.Path ]::Combine($env: USERPROFILE , " .unitysetup" )
261+ [string ]$Cache = [io.Path ]::Combine($env: USERPROFILE , " .unitysetup" ),
262+
263+ [parameter (Mandatory = $false )]
264+ [ValidateSet (' Open' , ' RunAs' )]
265+ [string ]$Verb
262266 )
263267
264268 process
@@ -321,10 +325,19 @@ function Install-UnitySetupInstance
321325 $installer = $localInstallers [$i ]
322326 $destination = $localDestinations [$i ]
323327
324- $args = @ (" /S" , " /D=$ ( $localDestinations [$i ]) " )
328+ $startProcessArgs = @ {
329+ ' FilePath' = $installer ;
330+ ' ArgumentList' = @ (" /S" , " /D=$ ( $localDestinations [$i ]) " );
331+ ' PassThru' = $true ;
332+ }
333+
334+ if ($Verb )
335+ {
336+ $startProcessArgs [' Verb' ] = $Verb
337+ }
325338
326339 $spinnerIndex = 0
327- $process = Start-Process - FilePath $installer - ArgumentList $args - PassThru
340+ $process = Start-Process @startProcessArgs
328341 while (! $process.HasExited )
329342 {
330343 Write-Host " `r Installing $installer to $destination - $ ( $spins [$spinnerIndex ++ % $spins.Length ]) " - NoNewline
You can’t perform that action at this time.
0 commit comments