InvalidArgument: (System.Collections.ArrayList:String) [Install-Package], Exception

Mark Pizzolato's Avatar

Mark Pizzolato

27 Jun, 2025 12:55 AM

I got this problem on Windows 11 while trying to setup my own system using the local Hyper-V. I AM running in an elevated (PowerShell). I'm wanting to configure a Ubuntu VM and that bounced with an issue pointing at the need to run packer to fix something. While following those instructions I destroyed a .json file so I wanted to back out everything and start over. Now I'm stuck with:

```
PS C:\Users\Admin> Install-Module AppVeyorBYOC -Scope CurrentUser -Force; Import-Module AppVeyorBYOC
PackageManagement\Install-Package : Administrator rights are required to install or update. Log on to the computer
with an account that has Administrator rights, and then try again, or install by adding "-Scope CurrentUser" to your
command. You can also try running the Windows PowerShell session with elevated rights (Run as Administrator).
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ... $null = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (System.Collections.ArrayList:String) [Install-Package], Exception
    + FullyQualifiedErrorId : AdministratorRightsNeededOrSpecifyCurrentUserScope,Copy-Module,Microsoft.PowerShell.Pack
   ageManagement.Cmdlets.InstallPackage

Import-Module : The specified module 'AppVeyorBYOC' was not loaded because no valid module file was found in any
module directory.
At line:1 char:56
+ ... le AppVeyorBYOC -Scope CurrentUser -Force; Import-Module AppVeyorBYOC
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ResourceUnavailable: (AppVeyorBYOC:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
```

How to move forward from here.

Thanks.

  1. Support Staff 1 Posted by Owen McDonnell on 27 Jun, 2025 08:25 PM

    Owen McDonnell's Avatar

    Can you follow the directions here to update PowerShellGet and then run your command again.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac