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

get-msisummaryinfo : A share violation has occurred #39

Closed
A9G-Data-Droid opened this issue Feb 5, 2020 · 6 comments · Fixed by #40
Closed

get-msisummaryinfo : A share violation has occurred #39

A9G-Data-Droid opened this issue Feb 5, 2020 · 6 comments · Fixed by #40
Assignees

Comments

@A9G-Data-Droid
Copy link

After installing from PSGallery I am getting this error when trying to use get-msisummaryinfo. I'm not sure what this means. Is there a step I am missing?

PS > Install-Package msi

Name                           Version          Source           Summary
----                           -------          ------           -------
MSI                            3.2.33           PSGallery        Exposes Windows Installer functionality to Windows ...


PS > get-msisummaryinfo
get-msisummaryinfo : A share violation has occurred
At line:1 char:1
+ get-msisummaryinfo
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotImplemented: (:) [Get-MSISummaryInfo], PSNotSupportedException
    + FullyQualifiedErrorId : NotSupported,Microsoft.Tools.WindowsInstaller.PowerShell.Commands.GetSummaryInfoCommand
@heaths
Copy link
Owner

heaths commented Feb 5, 2020

A path argument is required but doesn't seem like it's enforced for parameter binding. While technically it's a breaking change, since this invocation only errs it should be okay to make a breaking change to require at least one argument.

To see how to use the cmdlets, please run help <cmdlet> or help <cmdlet> -full to see more detailed help including parameters.

@heaths heaths self-assigned this Feb 5, 2020
@A9G-Data-Droid
Copy link
Author

Thanks, I'm used to help being displayed when no arguments are passed. This is traditionally how commands behave. "A share violation has occurred" doesn't explain that an argument is required. It sounds more like a bug in the code.

@heaths
Copy link
Owner

heaths commented Feb 5, 2020

PowerShell doesn't work that way, unfortunately. You can pass -? as a sole argument which PowerShell translates to help <cmdlet>, but that's undocumented. Normally, help <cmdlet> or help about_<topic> is what you need to do. You can also run help about to see all available about topics.

So, just to be clear, this cmdlet (or any cmdlet, unless they handle it themselves which would be non-standard) will not display help when no arguments are passed.

Still, I can fix this specific problem since it shouldn't fail that way. It (and all other cmdlets) will prompt for required arguments, though.

@heaths
Copy link
Owner

heaths commented Feb 7, 2020

Note to self: this happens with several cmdlets. Was there some reason why or was it just an oversight?

  • Get-MSIFileType
  • Edit-MSIPackage (one sharing violation, but then enumerated files in $PWD which is also incorrect)
  • Get-MSISummaryInfo

heaths added a commit that referenced this issue Feb 17, 2020
@heaths
Copy link
Owner

heaths commented Feb 17, 2020

Digging in more, I'm going to leave all but Get-MSISummaryInfo because the others are designed to enumerate all files if no parameters. Not sure why I was getting the sharing violation on one machine, but was unable to reproduce on another.

@heaths
Copy link
Owner

heaths commented Feb 17, 2020

PowerShell Gallery has been updated with MSI version 3.3.4 with a fix for this specific issue. If -Path isn't specified, PowerShell will prompt (unless started with -NonInteractive). Bear in mind, however, that cmdlets don't emit help if you don't pass required parameters. Use help <cmdlet> for more information.

Thanks for reporting!

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

Successfully merging a pull request may close this issue.

2 participants