File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,11 @@ function Install-UnitySetupInstance
236236 [string ]$Destination ,
237237
238238 [parameter (Mandatory = $false )]
239- [string ]$Cache = [io.Path ]::Combine($env: USERPROFILE , " .unitysetup" )
239+ [string ]$Cache = [io.Path ]::Combine($env: USERPROFILE , " .unitysetup" ),
240+
241+ [parameter (Mandatory = $false )]
242+ [ValidateSet (' Open' , ' RunAs' )]
243+ [string ]$Verb
240244 )
241245
242246 process
@@ -299,10 +303,19 @@ function Install-UnitySetupInstance
299303 $installer = $localInstallers [$i ]
300304 $destination = $localDestinations [$i ]
301305
302- $args = @ (" /S" , " /D=$ ( $localDestinations [$i ]) " )
306+ $startProcessArgs = @ {
307+ ' FilePath' = $installer ;
308+ ' ArgumentList' = @ (" /S" , " /D=$ ( $localDestinations [$i ]) " );
309+ ' PassThru' = $true ;
310+ }
311+
312+ if ($Verb )
313+ {
314+ $startProcessArgs [' Verb' ] = $Verb
315+ }
303316
304317 $spinnerIndex = 0
305- $process = Start-Process - FilePath $installer - ArgumentList $args - PassThru
318+ $process = Start-Process @startProcessArgs
306319 while (! $process.HasExited )
307320 {
308321 Write-Host " `r Installing $installer to $destination - $ ( $spins [$spinnerIndex ++ % $spins.Length ]) " - NoNewline
You can’t perform that action at this time.
0 commit comments