Visitar URL original
Add-AppxPackage doesn't handle string array param DependencyPath in PS7 · Issue #18708 · PowerShell/PowerShell · GitHub
The Wayback Machine - https://web.archive.org/web/20240324120821/https://github.com/PowerShell/PowerShell/issues/18708
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add-AppxPackage doesn't handle string array param DependencyPath in PS7 #18708

Open
5 tasks done
MSLukeWest opened this issue Dec 2, 2022 · 13 comments
Open
5 tasks done
Labels
Needs-Triage The issue is new and needs to be triaged by a work group.

Comments

@MSLukeWest
Copy link

MSLukeWest commented Dec 2, 2022 •

Prerequisites

Steps to reproduce

Call Add-AppxPackage in PS7, passing in an array of paths for the DependencyPath argument

Required Setup: "c:\Package\Dependencies" contains two msix files, Foo.msix and Bar.msix

$DependencyPackages = @()
$DependencyPackages += Get-ChildItem ("c:\Package\Dependencies*.msix") | Where-Object { $_.Mode -NotMatch "d" }
Add-AppxPackage -Path "c:\Package\Main.msix" -DependencyPath $DependencyPackages.FullName -ForceApplicationShutdown

Expected behavior

Add-AppxPackage successfully installs dependencies Foo and Bar. This is how 5.1 works.

Actual behavior

It combines the two array items into a single string, resulting in error:

Add-AppxPackage: Cannot find path 'c:\Package\Dependencies\Foo.msix c:\Package\Dependencies\Bar.msix' because it does not exist.

Error details

OriginInfo : localhost
Exception :
Type : System.Management.Automation.RemoteException
SerializedRemoteException : System.Management.Automation.ItemNotFoundException: Cannot find path 'C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx' because it does not exist.
at System.Management.Automation.LocationGlobber.ExpandMshGlobPath(String path, Boolean allowNonexistingPaths, PSDriveInfo drive, ContainerCmdletProvider provider, CmdletProviderContext context)
at System.Management.Automation.LocationGlobber.ResolveDriveQualifiedPath(String path, CmdletProviderContext context, Boolean allowNonexistingPaths, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedMonadPathsFromMonadPath(String path, Boolean allowNonexistingPaths, CmdletProviderContext context, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedProviderPathsFromMonadPath(String path, Boolean allowNonexistingPaths, CmdletProviderContext context, ProviderInfo& provider, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedProviderPathsFromMonadPath(String path, Boolean allowNonexistingPaths, ProviderInfo& provider, CmdletProvider& providerInstance)
at System.Management.Automation.PSCmdlet.GetResolvedProviderPathFromPSPath(String path, ProviderInfo& provider)
at Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand.ResolveArgumentPath(String path)
at Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand.EvaluateParameters()
at Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
SerializedRemoteInvocationInfo : System.Management.Automation.InvocationInfo
ErrorRecord :
Exception :
Type : System.Management.Automation.RemoteException
SerializedRemoteException : System.Management.Automation.ItemNotFoundException: Cannot find path 'C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx' because it does not exist.
at System.Management.Automation.LocationGlobber.ExpandMshGlobPath(String path, Boolean allowNonexistingPaths, PSDriveInfo drive, ContainerCmdletProvider provider, CmdletProviderContext context)
at System.Management.Automation.LocationGlobber.ResolveDriveQualifiedPath(String path, CmdletProviderContext context, Boolean allowNonexistingPaths, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedMonadPathsFromMonadPath(String path, Boolean allowNonexistingPaths, CmdletProviderContext context, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedProviderPathsFromMonadPath(String path, Boolean allowNonexistingPaths, CmdletProviderContext context, ProviderInfo& provider, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedProviderPathsFromMonadPath(String path, Boolean allowNonexistingPaths, ProviderInfo& provider, CmdletProvider& providerInstance)
at System.Management.Automation.PSCmdlet.GetResolvedProviderPathFromPSPath(String path, ProviderInfo& provider)
at Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand.ResolveArgumentPath(String path)
at Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand.EvaluateParameters()
at Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
SerializedRemoteInvocationInfo : System.Management.Automation.InvocationInfo
ErrorRecord :
Exception :
Type : System.Management.Automation.RemoteException
SerializedRemoteException : System.Management.Automation.ItemNotFoundException: Cannot find path 'C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx' because it does not exist.
at System.Management.Automation.LocationGlobber.ExpandMshGlobPath(String path, Boolean allowNonexistingPaths, PSDriveInfo drive, ContainerCmdletProvider provider, CmdletProviderContext context)
at System.Management.Automation.LocationGlobber.ResolveDriveQualifiedPath(String path, CmdletProviderContext context, Boolean allowNonexistingPaths, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedMonadPathsFromMonadPath(String path, Boolean allowNonexistingPaths, CmdletProviderContext context, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedProviderPathsFromMonadPath(String path, Boolean allowNonexistingPaths, CmdletProviderContext context, ProviderInfo& provider, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedProviderPathsFromMonadPath(String path, Boolean allowNonexistingPaths, ProviderInfo& provider, CmdletProvider& providerInstance)
at System.Management.Automation.PSCmdlet.GetResolvedProviderPathFromPSPath(String path, ProviderInfo& provider)
at Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand.ResolveArgumentPath(String path)
at Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand.EvaluateParameters()
at Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
SerializedRemoteInvocationInfo : System.Management.Automation.InvocationInfo
ErrorRecord :
Exception :
Type : System.Management.Automation.RemoteException
SerializedRemoteException : System.Management.Automation.ItemNotFoundException: Cannot find path 'C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx' because it does not exist.
at System.Management.Automation.LocationGlobber.ExpandMshGlobPath(String path, Boolean allowNonexistingPaths, PSDriveInfo drive, ContainerCmdletProvider provider, CmdletProviderContext context)
at System.Management.Automation.LocationGlobber.ResolveDriveQualifiedPath(String path, CmdletProviderContext context, Boolean allowNonexistingPaths, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedMonadPathsFromMonadPath(String path, Boolean allowNonexistingPaths, CmdletProviderContext context, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedProviderPathsFromMonadPath(String path, Boolean allowNonexistingPaths, CmdletProviderContext context, ProviderInfo& provider, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedProviderPathsFromMonadPath(String path, Boolean allowNonexistingPaths, ProviderInfo& provider, CmdletProvider& providerInstance)
at System.Management.Automation.PSCmdlet.GetResolvedProviderPathFromPSPath(String path, ProviderInfo& provider)
at Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand.ResolveArgumentPath(String path)
at Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand.EvaluateParameters()
at Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
SerializedRemoteInvocationInfo : System.Management.Automation.InvocationInfo
ErrorRecord :
Exception :
Type : System.Management.Automation.RemoteException
SerializedRemoteException : System.Management.Automation.ItemNotFoundException: Cannot find path 'C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx' because it does not exist.
at System.Management.Automation.LocationGlobber.ExpandMshGlobPath(String path, Boolean allowNonexistingPaths, PSDriveInfo drive, ContainerCmdletProvider provider, CmdletProviderContext context)
at System.Management.Automation.LocationGlobber.ResolveDriveQualifiedPath(String path, CmdletProviderContext context, Boolean allowNonexistingPaths, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedMonadPathsFromMonadPath(String path, Boolean allowNonexistingPaths, CmdletProviderContext context, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedProviderPathsFromMonadPath(String path, Boolean allowNonexistingPaths, CmdletProviderContext context, ProviderInfo& provider, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedProviderPathsFromMonadPath(String path, Boolean allowNonexistingPaths, ProviderInfo& provider, CmdletProvider& providerInstance)
at System.Management.Automation.PSCmdlet.GetResolvedProviderPathFromPSPath(String path, ProviderInfo& provider)
at Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand.ResolveArgumentPath(String path)
at Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand.EvaluateParameters()
at Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
SerializedRemoteInvocationInfo : System.Management.Automation.InvocationInfo
ErrorRecord : …
Message : Cannot find path 'C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx' because it does not exist.
HResult : -2146233087
TargetObject : C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx
CategoryInfo : ObjectNotFound: (C:\Users\lukewest\D…Libs.x64.14.00.appx:String) [Add-AppxPackage], ItemNotFoundException
FullyQualifiedErrorId : PathNotFound,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand
Message : Cannot find path 'C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx' because it does not exist.
HResult : -2146233087
TargetObject : C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx
CategoryInfo : ObjectNotFound: (C:\Users\lukewest\D…Libs.x64.14.00.appx:String) [Add-AppxPackage], ItemNotFoundException
FullyQualifiedErrorId : PathNotFound,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand
Message : Cannot find path 'C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx' because it does not exist.
HResult : -2146233087
TargetObject : C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx
CategoryInfo : ObjectNotFound: (C:\Users\lukewest\D…Libs.x64.14.00.appx:String) [Add-AppxPackage], ItemNotFoundException
FullyQualifiedErrorId : PathNotFound,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand
Message : Cannot find path 'C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx' because it does not exist.
HResult : -2146233087
TargetObject : C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx
CategoryInfo : ObjectNotFound: (C:\Users\lukewest\D…Libs.x64.14.00.appx:String) [Add-AppxPackage], ItemNotFoundException
FullyQualifiedErrorId : PathNotFound,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand
Message : Cannot find path 'C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx' because it does not exist.
HResult : -2146233087
TargetObject : C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Framework.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.NET.Native.Runtime.2.2.appx C:\Users\lukewest\Desktop\1667099_Repro\Uwp\App8_1.0.0.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.appx
CategoryInfo : ObjectNotFound: (C:\Users\lukewest\D…Libs.x64.14.00.appx:String) [Add-AppxPackage], ItemNotFoundException
FullyQualifiedErrorId : PathNotFound,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.0
PSEdition                      Core
GitCommitId                    7.3.0
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

@MSLukeWest MSLukeWest added the Needs-Triage The issue is new and needs to be triaged by a work group. label Dec 2, 2022
@MSLukeWest
Copy link
Author

MSLukeWest commented Dec 2, 2022 •

This was noticed in the Add-AppDevPackage.ps1 script that gets shipped with Visual Studio, see https://developercommunity.visualstudio.com/t/Installps1-script-fails-to-install-depe/10186233

Visual Studio Feedback

@kilasuit
Copy link
Collaborator

kilasuit commented Dec 3, 2022 •

@MSLukeWest I think on quick reading and not being able to replicate as I don't work with msix's I think that you may have missed out a vital step out

Can you try this and see if that works instead

$DependencyPackages = @()
$DependencyPackages += "c:\Package\Dependencies\Foo.msix"
$DependencyPackages += "c:\Package\Dependencies\Bar.msix"
$DependencyPackages = Get-item $DependencyPackages
Add-AppxPackage -Path "c:\Package\Main.msix" -DependencyPath $DependencyPackages.FullName -ForceApplicationShutdown

@MSLukeWest
Copy link
Author

@kilasuit Thanks for taking a look. I realized that in trying to simplify the repro steps I made a mistake, which has now been corrected under "Steps To Reproduce". Can you take another look?

@MSLukeWest
Copy link
Author

@kilasuit Can you take a look at my updated repro steps above?

@asklar
Copy link

asklar commented Feb 6, 2023

@kilasuit is there something that the Add-AppxPackage can do to work around this issue? the script works fine in Windows PowerShell, but it is failing in pwsh core. This is causing app installs to fail when initiated from pwsh, so it's a pretty high priority for us.

@asklar
Copy link

asklar commented Feb 6, 2023

CC @SteveL-MSFT could you please help unblock us? 🙏

@SteveL-MSFT
Copy link
Member

The problem appears to be that the PS remoting generated proxy function incorrectly has the -DependencyPath parameter as a string instead of an array. So when PowerShell sees that it's just a string, it converts the array to a single space separate string and fails. Here's a simpler repro:

1 > 1.msix
2 > 2.msix
main > main.msix
$deps = gci ?.msix
$main = gci main.msix
add-appxpackage -path $main.fullname -dependencypath $deps.fullname

On Windows 11, the AppX module has been fixed to work directly in PS7, so remoting isn't used and the original command will work. Given that PS remoting is generating the proxy function and getting the signature wrong, I don't have a workaround for now for older Win 10 that still relies on PS remoting to Windows PowerShell to use AppX module.

@asklar
Copy link

asklar commented Feb 13, 2023

thanks @SteveL-MSFT - note that I'm hitting this on the latest internal Windows 11 builds, so even there it's not working as expected

@SteveL-MSFT
Copy link
Member

@asklar sorry, just checked my Win 11 system and the AppX module still reports itself as not PS7 compatible, so a WinPS session is created and remoting has this problem.

@SteveL-MSFT
Copy link
Member

I debugged this and the problem is this helper function which only handles SwitchParameter so then any other type becomes an object (even if it is an array). So then at parameter binding time, the array you pass gets coerced into a single object (string) which causes it to fail. In fact, any parameter that expects an array will fail over implicit remoting.

@PaulHigin do you know if this design is intended? I see there's another help to check type safety, but by the time that code is reached, it's either a switchparameter or object.

@asklar
Copy link

asklar commented Mar 9, 2023

@PaulHigin any updates? we're currently blocked by this.

@ACGNnsj
Copy link

ACGNnsj commented Apr 14, 2023

Same problem when running install scripts generated by VS.

@kuwana77499981
Copy link

kuwana77499981 commented Oct 30, 2023 •

Any updates? Can we see this as a bug that should be fixed in powershell that the receiving parameters are not the same type as documented?

Compared to the Copy-Item, we have String[] for -Path, but -DependencyPath, etc. in Add-AppxPackage are System.Object when we see the command using Show-Command.

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/copy-item?view=powershell-5.1
image

https://learn.microsoft.com/es-es/powershell/module/appx/add-appxpackage?view=winserver2012-ps
image

Thank you!

The Copy-Item cmdlet copies an item from one location to another location in the same namespace. For instance, it can copy a file to a folder, but it can't copy a file to a certificate drive. This cmdlet doesn't cut or delete the items being copied. The particular items that the cmdlet can copy depend on the PowerShell provider that exposes the item. For instance, it can copy files and directories in a file system drive and registry keys and entries in the registry drive. This cmdlet can copy and rename items in the same command. To rename an item, enter the new name in the value of the Destination parameter. To rename an item and not copy it, use the Rename-Item cmdlet.
The Add-AppxPackage cmdlet adds a signed app package (.appx) to a user account. An app package has an .appx file name extension. Use the DependencyPath parameter to add all other packages that are required for the installation of the app package. You can use the Register parameter to install from a folder of unpackaged files during development of Windows® Store apps. To update an already installed package, the new package must have the same package family name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Triage The issue is new and needs to be triaged by a work group.
Projects
None yet
Development

No branches or pull requests

6 participants