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

Expand-Archive has no -DestinationPath parameter #33

Open
kiinoo opened this issue Jun 5, 2022 · 2 comments
Open

Expand-Archive has no -DestinationPath parameter #33

kiinoo opened this issue Jun 5, 2022 · 2 comments

Comments

@kiinoo
Copy link

kiinoo commented Jun 5, 2022

const expandCmd = 'powershell -ExecutionPolicy Bypass -Command Expand-Archive ' + ['-Path', zipPath, '-DestinationPath', destinationDir, '-Force'].join(' ');

not sure if it is the problem of version of powershell, when I triedt to install this package, I got the error as the issue title,

would someone provide a fix?

thanks

@roblourens
Copy link
Member

You can see that it should have that parameter here: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.archive/expand-archive?view=powershell-7.2

What version of powershell are you using?

@disco0
Copy link

disco0 commented Dec 30, 2022

Ran into this, figured out the issue—powershell 5.1 was loading an older version of the Powershell Community Extensions module (pscx), whose Expand-Archive command shadows the builtin version and has no DestinationPath parameter—problem is gone after removing the import.

Might be worth updating function/cmdlet calls to their module-qualifed paths to avoid similar issues (e.g. Expand-Archive -> Microsoft.PowerShell.Archive\Expand-Archive)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants