InvalidArgument: (System.Collections.ArrayList:String) [Install-Package], Exception
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.
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
Support Staff 1 Posted by Owen McDonnell on 27 Jun, 2025 08:25 PM
Can you follow the directions here to update
PowerShellGet
and then run your command again.