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
236
236
[string ]$Destination ,
237
237
238
238
[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
240
244
)
241
245
242
246
process
@@ -299,10 +303,19 @@ function Install-UnitySetupInstance
299
303
$installer = $localInstallers [$i ]
300
304
$destination = $localDestinations [$i ]
301
305
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
+ }
303
316
304
317
$spinnerIndex = 0
305
- $process = Start-Process - FilePath $installer - ArgumentList $args - PassThru
318
+ $process = Start-Process @startProcessArgs
306
319
while (! $process.HasExited )
307
320
{
308
321
Write-Host " `r Installing $installer to $destination - $ ( $spins [$spinnerIndex ++ % $spins.Length ]) " - NoNewline
You can’t perform that action at this time.
0 commit comments