From befebd2aa3e7437b6b51ae0219a65a3b10788c0c Mon Sep 17 00:00:00 2001 From: Josh Wittner Date: Thu, 12 Sep 2024 14:03:39 -0700 Subject: [PATCH 01/16] Drop alpha branch after testing --- appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 784bb61..a236968 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -37,4 +37,3 @@ for: branches: only: - develop - - alpha From 41dd7a4ad16362fa1585cc04df83a9cb183e6568 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 24 Sep 2024 11:34:13 -0700 Subject: [PATCH 02/16] Removed the auth token from the output, replaced with a 'Suceeded' column. --- UnitySetup/UnitySetup.psm1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index 548e677..eb0cc93 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -2824,7 +2824,12 @@ function Update-UnityPackageManagerConfig { } Write-Verbose "Summary" - Write-Output $upmConfigs + $upmConfigs | ForEach-Object { + [PSCustomObject]@{ + ScopedURL = $_.ScopedURL + Succeeded = -not [string]::IsNullOrEmpty($_.Auth) + } + } | Format-Table -AutoSize } if ($VerifyOnly) { From 18e64ef4c699a5c54d475df42fe0353c239d8415 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 24 Sep 2024 14:21:27 -0700 Subject: [PATCH 03/16] Explicitly print formatted table or 'no changes were made' --- UnitySetup/UnitySetup.psm1 | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index eb0cc93..782e568 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -2823,13 +2823,19 @@ function Update-UnityPackageManagerConfig { Export-UPMConfig -UPMConfig $upmConfigs -tomlFilePaths $tomlFilePaths } - Write-Verbose "Summary" - $upmConfigs | ForEach-Object { - [PSCustomObject]@{ - ScopedURL = $_.ScopedURL - Succeeded = -not [string]::IsNullOrEmpty($_.Auth) - } - } | Format-Table -AutoSize + if ($upmConfigs) { + Write-Verbose "Summary" + $upmConfigs = $upmConfigs | ForEach-Object { + [PSCustomObject]@{ + ScopedURL = $_.ScopedURL + Succeeded = -not [string]::IsNullOrEmpty($_.Auth) + } + } | Format-Table -AutoSize + + Write-Verbose $upmConfigs + } else { + Write-Verbose "No changes were made" + } } if ($VerifyOnly) { From 5a53a97cfa27110e21c9a3740abd6247cbe73e94 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 24 Sep 2024 14:24:27 -0700 Subject: [PATCH 04/16] Whoops - needed an out-string --- UnitySetup/UnitySetup.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index 782e568..287e2e6 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -2830,7 +2830,7 @@ function Update-UnityPackageManagerConfig { ScopedURL = $_.ScopedURL Succeeded = -not [string]::IsNullOrEmpty($_.Auth) } - } | Format-Table -AutoSize + } | Format-Table -AutoSize | Out-String Write-Verbose $upmConfigs } else { From 6718154ea2d65d75478661d81142dd49c87324dd Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 24 Sep 2024 14:41:55 -0700 Subject: [PATCH 05/16] Remove the out-string --- UnitySetup/UnitySetup.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index 287e2e6..782e568 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -2830,7 +2830,7 @@ function Update-UnityPackageManagerConfig { ScopedURL = $_.ScopedURL Succeeded = -not [string]::IsNullOrEmpty($_.Auth) } - } | Format-Table -AutoSize | Out-String + } | Format-Table -AutoSize Write-Verbose $upmConfigs } else { From 88411f8dbca59250485e4e93768581870e0c1503 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 25 Sep 2024 14:42:30 -0700 Subject: [PATCH 06/16] Add out-string back in to fix data type error --- UnitySetup/UnitySetup.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index 782e568..287e2e6 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -2830,7 +2830,7 @@ function Update-UnityPackageManagerConfig { ScopedURL = $_.ScopedURL Succeeded = -not [string]::IsNullOrEmpty($_.Auth) } - } | Format-Table -AutoSize + } | Format-Table -AutoSize | Out-String Write-Verbose $upmConfigs } else { From 3bf877991534f70ae27b191bcacaaf1ae333234a Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 3 Dec 2024 11:45:15 -0800 Subject: [PATCH 07/16] Updates to handle new secure string response for Az.Accounts 4.0+ --- UnitySetup/UnitySetup.psm1 | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index 287e2e6..101af1f 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -2214,15 +2214,7 @@ function New-PAT { [guid]$AzureSubscription ) - $azAccountsVersion = Get-ModuleVersion -ModuleName "Az.Accounts" - if ($azAccountsVersion) { - if ($azAccountsVersion -lt [version]"1.8" -or $azAccountsVersion -gt [version]"3.9.9999") { - if ($azAccountsVersion -ge [version]"4.0") { - throw "Az.Accounts version 4.0 includes a breaking change and is not compatible." - } - } - } - + $expireDate = (Get-Date).AddDays($ExpireDays).ToString('yyyy-MM-ddTHH:mm:ss.fffZ') $createPAT = 'y' @@ -2254,8 +2246,18 @@ Would you like to continue? (Default: $($createPAT))" } Connect-AzAccount @connectArgs | Out-Null } - $AZTokenRequest = Get-AzAccessToken -ResourceType Arm - $headers = @{ Authorization = "Bearer $($AZTokenRequest.Token)" } + + $AZToken = $null + $azAccountsVersion = Get-ModuleVersion -ModuleName "Az.Accounts" + if ($azAccountsVersion -ge [version]"4.0") { + $AZTokenRequest = Get-AzAccessToken -AsSecureString -ResourceType Arm + $AZToken = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($AZTokenRequest.Token)) + } else { + $AZTokenRequest = Get-AzAccessToken -ResourceType Arm + $AZToken = $AZTokenRequest.Token + } + + $headers = @{ Authorization = "Bearer $($AZToken)" } } else { $headers = @{ Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN" } From 960031dc7445c0b577dda6f7b6ecd52a0b071b90 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 3 Dec 2024 13:38:06 -0800 Subject: [PATCH 08/16] + Use consistent securestring conversion + Require 2.17 Az.Accounts and drop conditional --- UnitySetup/UnitySetup.psd1 | 2 +- UnitySetup/UnitySetup.psm1 | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/UnitySetup/UnitySetup.psd1 b/UnitySetup/UnitySetup.psd1 index 0041b96..bb7a7d5 100644 --- a/UnitySetup/UnitySetup.psd1 +++ b/UnitySetup/UnitySetup.psd1 @@ -55,7 +55,7 @@ # Modules that must be imported into the global environment prior to importing this module RequiredModules = @( @{ModuleName = "powershell-yaml"; ModuleVersion = "0.3"; Guid = "6a75a662-7f53-425a-9777-ee61284407da" }, - @{ModuleName = "Az.Accounts"; ModuleVersion = "1.8.0"; Guid = "17a2feff-488b-47f9-8729-e2cec094624c" } + @{ModuleName = "Az.Accounts"; ModuleVersion = "2.17.0"; Guid = "17a2feff-488b-47f9-8729-e2cec094624c" } ) # Assemblies that must be loaded prior to importing this module diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index 101af1f..901b124 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -2248,14 +2248,8 @@ Would you like to continue? (Default: $($createPAT))" } $AZToken = $null - $azAccountsVersion = Get-ModuleVersion -ModuleName "Az.Accounts" - if ($azAccountsVersion -ge [version]"4.0") { - $AZTokenRequest = Get-AzAccessToken -AsSecureString -ResourceType Arm - $AZToken = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($AZTokenRequest.Token)) - } else { - $AZTokenRequest = Get-AzAccessToken -ResourceType Arm - $AZToken = $AZTokenRequest.Token - } + $AZTokenRequest = Get-AzAccessToken -AsSecureString -ResourceType Arm + $AZToken = [System.Net.NetworkCredential]::new($null, $AZTokenRequest.Token).Password $headers = @{ Authorization = "Bearer $($AZToken)" } } From d8cc2866a3ef08cdd39e3273f0adddade95be63b Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 3 Dec 2024 14:13:38 -0800 Subject: [PATCH 09/16] Remove unnecessary null assignment --- UnitySetup/UnitySetup.psm1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index 901b124..d0d5ee9 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -2247,10 +2247,9 @@ Would you like to continue? (Default: $($createPAT))" Connect-AzAccount @connectArgs | Out-Null } - $AZToken = $null $AZTokenRequest = Get-AzAccessToken -AsSecureString -ResourceType Arm $AZToken = [System.Net.NetworkCredential]::new($null, $AZTokenRequest.Token).Password - + $headers = @{ Authorization = "Bearer $($AZToken)" } } else { From f3007ebcc7b9f483b2f44ea9c9ffee5fced48cd6 Mon Sep 17 00:00:00 2001 From: Josh Wittner Date: Mon, 27 Jan 2025 09:41:19 -0800 Subject: [PATCH 10/16] Update az.accounts to 2.19 --- UnitySetup/UnitySetup.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitySetup/UnitySetup.psd1 b/UnitySetup/UnitySetup.psd1 index bb7a7d5..24acfb2 100644 --- a/UnitySetup/UnitySetup.psd1 +++ b/UnitySetup/UnitySetup.psd1 @@ -55,7 +55,7 @@ # Modules that must be imported into the global environment prior to importing this module RequiredModules = @( @{ModuleName = "powershell-yaml"; ModuleVersion = "0.3"; Guid = "6a75a662-7f53-425a-9777-ee61284407da" }, - @{ModuleName = "Az.Accounts"; ModuleVersion = "2.17.0"; Guid = "17a2feff-488b-47f9-8729-e2cec094624c" } + @{ModuleName = "Az.Accounts"; ModuleVersion = "2.19.0"; Guid = "17a2feff-488b-47f9-8729-e2cec094624c" } ) # Assemblies that must be loaded prior to importing this module From 15fc32142e1eddb78b5c6d851342c3eb7b1b6aa4 Mon Sep 17 00:00:00 2001 From: Josh Wittner Date: Tue, 10 Jun 2025 14:22:39 -0700 Subject: [PATCH 11/16] Fix for carriage/newline/space in regex --- UnitySetup/UnitySetup.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index d0d5ee9..cca0ebf 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -2349,7 +2349,7 @@ function Read-PATFromUser($OrgName) { } function Get-RegExForConfig($Org, $Project, $Feed, $PAT) { - $regexresult = "[`r`n]*\[npmAuth\.""https:\/\/pkgs.dev.azure.com\/$($Org)\/" + $regexresult = "[\n\r\s]*\[npmAuth\.""https:\/\/pkgs.dev.azure.com\/$($Org)\/" if (-not [string]::IsNullOrEmpty($Project)) { $regexresult += "$($Project)\/" } From 9b54bb42b5e824f1e150aa95e626d6d7e856dfc7 Mon Sep 17 00:00:00 2001 From: Josh Wittner Date: Tue, 10 Jun 2025 17:19:32 -0700 Subject: [PATCH 12/16] Empty From 3658d65a03a5d1ebb516f36a9fd3b9de5bb0b2b2 Mon Sep 17 00:00:00 2001 From: Josh Wittner Date: Tue, 10 Jun 2025 17:21:26 -0700 Subject: [PATCH 13/16] Install right version of required module az.accounts --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index a236968..943afc4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,7 +14,7 @@ install: Install-Module 'powershell-yaml' -Scope CurrentUser -Force -AllowClobber -Verbose - Install-Module 'Az.Accounts' -RequiredVersion 2.15.1 -Scope CurrentUser -Force -AllowClobber -Verbose + Install-Module 'Az.Accounts' -RequiredVersion 2.19.0 -Scope CurrentUser -Force -AllowClobber -Verbose build_script: - ps: .\build.ps1 -Revision "$env:APPVEYOR_BUILD_NUMBER" -Suffix "$env:APPVEYOR_REPO_BRANCH" deploy_script: From e0a6370b4e8f40450301ac88c9e3cef61ce3ce0c Mon Sep 17 00:00:00 2001 From: Josh Wittner Date: Tue, 10 Jun 2025 17:39:26 -0700 Subject: [PATCH 14/16] Skip install of nuget package provider --- appveyor.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 943afc4..e01e714 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,8 +6,6 @@ install: - ps: >- $ErrorActionPreference = 'Stop' - Install-PackageProvider -Name NuGet -Force - Remove-Module 'PowerShellGet' -Force -ErrorAction SilentlyContinue -Verbose Install-Module 'PowerShellGet' -Scope CurrentUser -Force -AllowClobber -Verbose From 507de01c597305260aef4db763f14836e0a1cf40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Misuth?= <38385570+gmisuth@users.noreply.github.com> Date: Tue, 28 Oct 2025 19:00:19 +0100 Subject: [PATCH 15/16] Update Unity URLs from unity3d.com to unity.com Add Release and Build to the end of the URL to search for a editor version --- UnitySetup/UnitySetup.psm1 | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index cca0ebf..93eb1b4 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -433,9 +433,9 @@ function Find-UnitySetupInstaller { $unitySetupRegEx = "^(.+)\/([a-z0-9]+)\/(.+)\/(.+)-(\d+)\.(\d+)\.(\d+)([fpba])(\d+).$installerExtension$" $knownBaseUrls = @( - "https://download.unity3d.com/download_unity", - "https://netstorage.unity3d.com/unity", - "https://beta.unity3d.com/download" + "https://download.unity.com/download_unity", + "https://netstorage.unity.com/unity", + "https://beta.unity.com/download" ) $installerTemplates = @{ @@ -502,36 +502,36 @@ function Find-UnitySetupInstaller { # Every release type has a different pattern for finding installers $searchPages = @() switch ($Version.Release) { - 'a' { $searchPages += "https://unity3d.com/alpha/$($Version.Major).$($Version.Minor)" } + 'a' { $searchPages += "https://unity.com/alpha/$($Version.Major).$($Version.Minor)" } 'b' { - $searchPages += "https://unity3d.com/unity/beta/unity$Version", - "https://unity3d.com/unity/beta/$($Version.Major).$($Version.Minor)", - "https://unity3d.com/unity/beta/$Version" + $searchPages += "https://unity.com/unity/beta/unity$Version", + "https://unity.com/unity/beta/$($Version.Major).$($Version.Minor)", + "https://unity.com/unity/beta/$Version" } 'f' { - $searchPages += "https://unity3d.com/get-unity/download/archive", - "https://unity3d.com/unity/whats-new/$($Version.Major).$($Version.Minor).$($Version.Revision)" + $searchPages += "https://unity.com/get-unity/download/archive", + "https://unity.com/releases/editor/whats-new/$($Version.Major).$($Version.Minor).$($Version.Revision)$($Version.Release)$($Version.Build)" # Just in case it's a release candidate search the beta as well. if ($Version.Revision -eq '0') { - $searchPages += "https://unity3d.com/unity/beta/unity$Version", - "https://unity3d.com/unity/beta/$($Version.Major).$($Version.Minor)", - "https://unity3d.com/unity/beta/$Version" + $searchPages += "https://unity.com/unity/beta/unity$Version", + "https://unity.com/unity/beta/$($Version.Major).$($Version.Minor)", + "https://unity.com/unity/beta/$Version" } } 'p' { - $patchPage = "https://unity3d.com/unity/qa/patch-releases?version=$($Version.Major).$($Version.Minor)" + $patchPage = "https://unity.com/unity/qa/patch-releases?version=$($Version.Major).$($Version.Minor)" $searchPages += $patchPage $webResult = Invoke-WebRequest $patchPage -UseBasicParsing $searchPages += $webResult.Links | Where-Object { $_.href -match "\/unity\/qa\/patch-releases\?version=$($Version.Major)\.$($Version.Minor)&page=(\d+)" -and $Matches[1] -gt 1 } | - ForEach-Object { "https://unity3d.com$($_.href)" } + ForEach-Object { "https://unity.com$($_.href)" } } } if($Hash -ne ""){ - $searchPages += "http://beta.unity3d.com/download/$Hash/download.html" + $searchPages += "http://beta.unity.com/download/$Hash/download.html" } foreach ($page in $searchPages) { @@ -1540,7 +1540,7 @@ function Test-UnityProjectInstanceMetaFileIntegrity { } } - # Derived from https://docs.unity3d.com/Manual/SpecialFolders.html + # Derived from https://docs.unity.com/Manual/SpecialFolders.html $unityAssetExcludes = @('.*', '*~', 'cvs', '*.tmp') foreach ( $p in $Project) { @@ -2696,7 +2696,7 @@ function Import-UnityProjectManifest { .Synopsis Ensures that the user has the appropriate auth tokens to fetch Unity packages in their .toml file. - For more information on Unity Package Manager config, please visit https://docs.unity3d.com/Manual/upm-config.html + For more information on Unity Package Manager config, please visit https://docs.unity.com/Manual/upm-config.html .DESCRIPTION Looks at the Unity Project Manifest and finds the scoped registries used for fetching NPM packages. From 86f98a16ccc4a7029880ec329e4be78391e76f78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Misuth?= <38385570+gmisuth@users.noreply.github.com> Date: Tue, 28 Oct 2025 19:19:45 +0100 Subject: [PATCH 16/16] Fix URLs in UnitySetup.psm1 comments --- UnitySetup/UnitySetup.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index 93eb1b4..59bdc89 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -1540,7 +1540,7 @@ function Test-UnityProjectInstanceMetaFileIntegrity { } } - # Derived from https://docs.unity.com/Manual/SpecialFolders.html + # Derived from https://docs.unity3d.com/Manual/SpecialFolders.html $unityAssetExcludes = @('.*', '*~', 'cvs', '*.tmp') foreach ( $p in $Project) { @@ -2696,7 +2696,7 @@ function Import-UnityProjectManifest { .Synopsis Ensures that the user has the appropriate auth tokens to fetch Unity packages in their .toml file. - For more information on Unity Package Manager config, please visit https://docs.unity.com/Manual/upm-config.html + For more information on Unity Package Manager config, please visit https://docs.unity3d.com/Manual/upm-config.html .DESCRIPTION Looks at the Unity Project Manifest and finds the scoped registries used for fetching NPM packages.