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 14
14
RootModule = ' UnitySetup'
15
15
16
16
# Version number of this module.
17
- ModuleVersion = ' 2.0 '
17
+ ModuleVersion = ' 2.1 '
18
18
19
19
# Supported PSEditions
20
20
# CompatiblePSEditions = @()
Original file line number Diff line number Diff line change @@ -258,7 +258,11 @@ function Install-UnitySetupInstance
258
258
[string ]$Destination ,
259
259
260
260
[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
262
266
)
263
267
264
268
process
@@ -321,10 +325,19 @@ function Install-UnitySetupInstance
321
325
$installer = $localInstallers [$i ]
322
326
$destination = $localDestinations [$i ]
323
327
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
+ }
325
338
326
339
$spinnerIndex = 0
327
- $process = Start-Process - FilePath $installer - ArgumentList $args - PassThru
340
+ $process = Start-Process @startProcessArgs
328
341
while (! $process.HasExited )
329
342
{
330
343
Write-Host " `r Installing $installer to $destination - $ ( $spins [$spinnerIndex ++ % $spins.Length ]) " - NoNewline
You can’t perform that action at this time.
0 commit comments