commit ab35bbaa9ee94c6a1191791073cf11b679dcfdc5
parent 1d99a668588e6e458d28142f7ae4f66c17c7bc94
Author: Jeremy Sinclair <4016293+snickler@users.noreply.github.com>
Date: Mon, 22 Apr 2024 13:22:59 -0400
Add Arm64 to list of architectures in Module Initialization. (#4251)
<!-- To check a checkbox place an "x" between the brackets. e.g: [x] -->
- [X] I have signed the [Contributor License
Agreement](https://cla.opensource.microsoft.com/microsoft/winget-pkgs).
- [X] This pull request is related to an issue.
- Resolves: #4169
-----
This PR addresses an issue that prevents the WinGet Cmdlets from loading
in an Arm64 PowerShell 7.x environment.
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/winget-cli/pull/4251)
Diffstat:
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/PowerShell/scripts/Initialize-LocalWinGetModules.ps1 b/src/PowerShell/scripts/Initialize-LocalWinGetModules.ps1
@@ -74,6 +74,7 @@ class WinGetModule
{
$x64Path = "$($this.Output)\$location\x64\"
$x86Path = "$($this.Output)\$location\x86\"
+ $arm64Path = "$($this.Output)\$location\arm64\"
if (-not (Test-Path $x64Path))
{
New-Item $x64Path -ItemType directory
@@ -84,6 +85,11 @@ class WinGetModule
New-Item $x86Path -ItemType directory
}
+ if (-not (Test-Path $arm64Path))
+ {
+ New-Item $arm64Path -ItemType directory
+ }
+
foreach ($f in $files)
{
$copyErrors = $null
@@ -91,6 +97,8 @@ class WinGetModule
$copyErrors | ForEach-Object { Write-Warning $_ }
Copy-Item "$buildRoot\x86\$config\$f" "$($this.Output)\$location\x86\" -Force -ErrorVariable copyErrors -ErrorAction SilentlyContinue
$copyErrors | ForEach-Object { Write-Warning $_ }
+ Copy-Item "$buildRoot\arm64\$config\$f" "$($this.Output)\$location\arm64\" -Force -ErrorVariable copyErrors -ErrorAction SilentlyContinue
+ $copyErrors | ForEach-Object { Write-Warning $_ }
}
}
@@ -98,6 +106,7 @@ class WinGetModule
{
$x64Path = "$($this.Output)\$location\x64\"
$x86Path = "$($this.Output)\$location\x86\"
+ $arm64Path = "$($this.Output)\$location\arm64\"
if (-not (Test-Path $x64Path))
{
New-Item $x64Path -ItemType directory
@@ -108,6 +117,11 @@ class WinGetModule
New-Item $x86Path -ItemType directory
}
+ if (-not (Test-Path $arm64Path))
+ {
+ New-Item $arm64Path -ItemType directory
+ }
+
foreach ($f in $files)
{
$copyErrors = $null
@@ -115,6 +129,8 @@ class WinGetModule
$copyErrors | ForEach-Object { Write-Warning $_ }
Copy-Item "$buildRoot\AnyCpu\$config\$f" "$($this.Output)\$location\x86\" -Force -ErrorVariable copyErrors -ErrorAction SilentlyContinue
$copyErrors | ForEach-Object { Write-Warning $_ }
+ Copy-Item "$buildRoot\AnyCpu\$config\$f" "$($this.Output)\$location\arm64\" -Force -ErrorVariable copyErrors -ErrorAction SilentlyContinue
+ $copyErrors | ForEach-Object { Write-Warning $_ }
}
}
}