Skip to content

Commit e2a115f

Browse files
Added private build support
Add the option to specify a Hash parameter when calling Find-UnitySetupInstaller, which looks for URIs using the hash provided, rather than detecting it based on the public builds available on the download archive page.
1 parent 1397b0e commit e2a115f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ function ConvertTo-UnitySetupComponent {
344344
Finds UnitySetup component installers for a specified version by querying Unity's website.
345345
.PARAMETER Version
346346
What version of Unity are you looking for?
347+
.PARAMETER Hash
348+
Manually specify the build hash, to select a private build.
347349
.PARAMETER Components
348350
What components would you like to search for? Defaults to All
349351
.EXAMPLE
@@ -358,7 +360,10 @@ function Find-UnitySetupInstaller {
358360
[UnityVersion] $Version,
359361

360362
[parameter(Mandatory = $false)]
361-
[UnitySetupComponent] $Components = [UnitySetupComponent]::All
363+
[UnitySetupComponent] $Components = [UnitySetupComponent]::All,
364+
365+
[parameter(Mandatory = $false)]
366+
[string] $Hash = ""
362367
)
363368

364369
$Components = ConvertTo-UnitySetupComponent -Component $Components -Version $Version
@@ -514,6 +519,10 @@ function Find-UnitySetupInstaller {
514519
$knownBaseUrls = $knownBaseUrls | Sort-Object -Property @{ Expression = { [math]::Abs(($_.CompareTo($linkComponents[0]))) }; Ascending = $true }
515520
}
516521

522+
if ($Hash -ne "") {
523+
$linkComponents[1] = $Hash
524+
}
525+
517526
$installerTemplates.Keys | Where-Object { $Components -band $_ } | ForEach-Object {
518527
$templates = $installerTemplates.Item($_);
519528
$result = $null

0 commit comments

Comments
 (0)