Added | Select-Object -Last 1 after Get-AppxPackage calls, because the calls might return an Array. (see Get-AppxPackage Documentation)
Changed Add-ProvisionedAppPackage to Add-ProvisionedAppxPackage for more clarity.
Motivation and Context
It fixes the Issue #228 that prevents installation or update of the microsoft-windows-terminal package.
How Has this Been Tested?
I manually changed the original script on my environment (Win 10 x64) and excuted the following command line:
& 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib-bad\microsoft-windows-terminal\1.21.2911\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters '' -preRunHookScripts $null -postRunHookScripts $null
Screenshot (if appropriate, usually isn't needed):
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] Migrated package (a package has been migrated from another repository)
Checklist:
[x] My code follows the code style of this repository.
[ ] My change requires a change to documentation (this usually means the notes in the description of a package).
[ ] I have updated the documentation accordingly (this usually means the notes in the description of a package).
[ ] I have updated the package description and it is less than 4000 characters.
Description
| Select-Object -Last 1
afterGet-AppxPackage
calls, because the calls might return an Array. (see Get-AppxPackage Documentation)Add-ProvisionedAppPackage
toAdd-ProvisionedAppxPackage
for more clarity.Motivation and Context
It fixes the Issue #228 that prevents installation or update of the microsoft-windows-terminal package.
How Has this Been Tested?
I manually changed the original script on my environment (Win 10 x64) and excuted the following command line:
& 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib-bad\microsoft-windows-terminal\1.21.2911\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters '' -preRunHookScripts $null -postRunHookScripts $null
Screenshot (if appropriate, usually isn't needed):
Types of changes
Checklist:
fixes #228