PowerShellGet: Unable to Bind 'Name' Parameter

Hello,

I’m having issues running the cmdlets in the PowerShellGet module due to errors binding to the Name parameter on Install-Module and others.

I’m running Windows 10 Pro 1511 on PowerShell version 5.0.10586.122.
PowerShellGet is version 1.0.0.1 and PackageManagement is 1.0.0.1

What I’m seeing:

C:\> Install-Module -Name 'PS.B2'
WARNING: Cannot bind argument to parameter 'name' because it is an empty string.

This happens for any attempted install.

A stack trace.

C:\> Install-Module -Name 'PS.B2'

DEBUG: 00:00:00 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0000214 Name: PS.B2
DEBUG: 00:00:00.0006394 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1
DEBUG: 00:00:00.0011700 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0024701 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0047517 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0047704 Name: PS.B2
DEBUG: 00:00:00.0052680 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1
DEBUG: 00:00:00.0057809 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0079721 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0115407 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0115613 Name: PS.B2
DEBUG: 00:00:00.0121130 INVOKING PowerShell Fn Get-DynamicOptions with args Package that has length 1
DEBUG: 00:00:00.0125992 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0151642 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0182846 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0183024 Name: PS.B2
DEBUG: 00:00:00.0188547 INVOKING PowerShell Fn Get-DynamicOptions with args Install that has length 1
DEBUG: 00:00:00.0193001 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0216431 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0829474 Calling SearchForPackages. Name='PS.B2'
DEBUG: 00:00:00.0840724 PackageProvider::FindPackage with name PS.B2
DEBUG: 00:00:00.0894369 Calling SearchForPackages After Select 1
DEBUG: 00:00:00.0942080 Calling New() : MethodName = 'FindPackage'
DEBUG: 00:00:00.0958598 ProviderName: PowerShellGet
DEBUG: 00:00:00.0968112 Type: Module
DEBUG: 00:00:00.1014778 Scope: AllUsers
DEBUG: 00:00:00.1025773 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1086929 Name: PS.B2
DEBUG: 00:00:00.1101304 INVOKING PowerShell Fn Find-Package with args System.String[], , ,  that has length 4
DEBUG: 00:00:00.1174410 In PowerShellGet Provider - 'Find-Package'.
DEBUG: 00:00:00.1183825 OPTION: ProviderName => PowerShellGet
DEBUG: 00:00:00.1246427 OPTION: Type => Module
DEBUG: 00:00:00.1284618 OPTION: Scope => AllUsers
DEBUG: 00:00:00.1297889 OPTION: MessageResolver => Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1366886 OPTION: Name => PS.B2
DEBUG: 00:00:00.1447721 PackageProvider::FindPackage with name PS.B2
DEBUG: 00:00:00.1498038 Calling 'NuGet'::'FindPackage' - name='PS.B2', requiredVersion='',minimumVersion='', maximumVersion='''.
DEBUG: 00:00:00.1516345 Iterating 'PS.B2'.
DEBUG: 00:00:00.1546262 There are '1' registered sources in 'NuGet' provider.
DEBUG: 00:00:00.1577787 Source 'https://www.powershellgallery.com/api/v2/' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:01.5077083 Source 'https://www.powershellgallery.com/api/v2/' is validated.
DEBUG: 00:00:01.5094951 Calling 'NuGetRequest'::'GetPackageById', 'PS.B2'.
DEBUG: 00:00:01.6895655 Calling 'HttpClientPackageRepository'::'FindPackagesById', 'PS.B2'.
DEBUG: 00:00:01.6913607 Calling 'NuGetClient'::'FindPackage'.
DEBUG: 00:00:01.6932891 Downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PS.B2'&$skip=0&$top=40'.
DEBUG: 00:00:02.0464745 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PS.B2'&$skip=0&$top=40'.
DEBUG: 00:00:02.0483073 '2' packages recevied in the last request.
DEBUG: 00:00:02.0502829 Completed iterating for 'PS.B2'.
DEBUG: 00:00:02.0660045 Done calling powershell «Find-Package» «PSModule»
DEBUG: 00:00:02.0720486 Calling New() : MethodName = 'GetInstalledPackages'
DEBUG: 00:00:02.0736516 ProviderName: PowerShellGet
DEBUG: 00:00:02.0759600 Type: Module
DEBUG: 00:00:02.0838472 Scope: AllUsers
DEBUG: 00:00:02.0858947 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:02.0893809 Name: PS.B2
DEBUG: 00:00:02.0907668 INVOKING PowerShell Fn Get-InstalledPackage with args PS.B2, 1.0.0, ,  that has length 4
DEBUG: 00:00:02.0956996 In PowerShellGet Provider - 'Get-InstalledPackage'.
DEBUG: 00:00:02.0970768 OPTION: ProviderName => PowerShellGet
DEBUG: 00:00:02.1034201 OPTION: Type => Module
DEBUG: 00:00:02.1048126 OPTION: Scope => AllUsers
DEBUG: 00:00:02.1082285 OPTION: MessageResolver => Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:02.1093492 OPTION: Name => PS.B2
WARNING: Cannot bind argument to parameter 'name' because it is an empty string.
DEBUG: 00:00:02.1593889 MSG:ScriptStackTrace «   at
System.Management.Automation.ParameterBinderBase.ValidateNullOrEmptyArgument(CommandParameterInternal parameter, CompiledCommandParameter
parameterMetadata, Type argumentType, Object parameterValue, Boolean recurseIntoCollections)
   at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter
parameterMetadata, ParameterBindingFlags flags)
   at System.Management.Automation.CmdletParameterBinderController.BindParameter(CommandParameterInternal argument,
MergedCompiledCommandParameter parameter, ParameterBindingFlags flags)
   at System.Management.Automation.CmdletParameterBinderController.BindParameter(UInt32 parameterSets, CommandParameterInternal argument,
MergedCompiledCommandParameter parameter, ParameterBindingFlags flags)
   at System.Management.Automation.CmdletParameterBinderController.BindParameters(UInt32 parameterSets, Collection`1 arguments)
   at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection`1 arguments)
   at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1 arguments)
   at System.Management.Automation.CommandProcessor.BindCommandLineParameters()
   at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues)
   at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)
   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean
enumerate)»
DEBUG: 00:00:02.1677405 Done calling powershell «Get-InstalledPackage» «PSModule»

What I’ve Tried:

- I’ve tried replacing the PackageManagement and PowerShellGet module folders from a working Windows 10 Pro install however the issue remained even while it did not occur on the working Windows 10 install I pulled them from.

- I’ve also tried reinstalling NuGet to version 2.8.5.204 and that did not help either.

- Lots of Googling but I’m unable to come up with anything related to this.

Weird… I’m not sure what’s going on here, but I’m going to forward this on to the PowerShell MVP mailing list. Hopefully one of the Microsoft folks will read it and help with the troubleshooting. :slight_smile:

Hi Dakota,

I’m a dev from the PowerShell team. Do you mind if I ask you a few questions to help identify the problem?

First of all, does this problem only exists for that particular module? Can you install other module?

Can you provide the results of running the following command:

  1. Get-Module PackageManagement).Path
  2. Install-Package “PS.B2” -Source https://www.powershellgallery.com/api/v2/ -Provider NuGet -Destination -Verbose -Debug

Thanks!

Hi Dakota,

Since this issue is reproducible only on your machine, could you please provide following details to investigate further?

  1. Run below command and upload the trace file C:\InstallModuleTraces.txt.
Trace-command -name metadata,parameterbinding,pipelineprocessor,cmdlet -expression {Install-Module -Name 'PS.B2'} -FilePath C:\InstallModuleTraces.txt
  1. Also run below command and provide the console output
PowerShell -noprofile {Install-Module -Name 'PS.B2' -verbose -debug}

Thanks,
Manikyam Bavandla [MSFT]
Windows PowerShell Team

Hi Quac,

The module paths I’m seeing are:

C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\PackageManagement.psd1
C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\PackageManagement.psd1

However I have to use the command below as with out the ListAvailable nothing is returned.

(Get-Module -ListAvailable PackageManagement).Path

However curiously I only see an single PSD1 file in the given directory despite Get-Module returning two.

When running the other command I was able to intall the package successfully after dropping the .

DEBUG: 00:00:00 Calling 'NuGet'::'ResolvePackageSources'.
DEBUG: 00:00:00.0000528 There are '1' registered sources in 'NuGet' provider.
DEBUG: 00:00:00.0000765 Source 'https://www.powershellgallery.com/api/v2/' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:00.7164882 Source 'https://www.powershellgallery.com/api/v2/' is validated.
DEBUG: 00:00:00.7166310 Yielding the package source: '«0»'. «NuGet» «Microsoft.PackageManagement.NuGetProvider.PackageSource»
DEBUG: 00:00:00.7167125 Yielding packge source for https://www.powershellgallery.com/api/v2/ at location
https://www.powershellgallery.com/api/v2/
DEBUG: 00:00:00.7167691 Returning the call 'NuGet'::'ResolvePackageSources'.
DEBUG: 00:00:09.4285970 Calling 'NuGet'::'ResolvePackageSources'.
DEBUG: 00:00:09.4286381 There are '1' registered sources in 'NuGet' provider.
DEBUG: 00:00:09.4286586 Source 'https://www.powershellgallery.com/api/v2/' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:09.8706816 Source 'https://www.powershellgallery.com/api/v2/' is validated.
DEBUG: 00:00:09.8707895 Yielding the package source: '«0»'. «NuGet» «Microsoft.PackageManagement.NuGetProvider.PackageSource»
DEBUG: 00:00:09.8708389 Yielding packge source for https://www.powershellgallery.com/api/v2/ at location
https://www.powershellgallery.com/api/v2/
DEBUG: 00:00:09.8708794 Returning the call 'NuGet'::'ResolvePackageSources'.
DEBUG: 00:00:09.8761136 Calling SearchForPackages. Name='PS.B2'
VERBOSE: Using the provider 'NuGet' for searching packages.
DEBUG: 00:00:09.8896645 PackageProvider::FindPackage with name PS.B2
DEBUG: 00:00:09.8915023 Calling SearchForPackages After Select 1
DEBUG: 00:00:09.9042169 Calling 'NuGet'::'FindPackage' - name='PS.B2', requiredVersion='',minimumVersion='', maximumVersion='''.
DEBUG: 00:00:09.9117029 Iterating 'PS.B2'.
DEBUG: 00:00:09.9308267 There are '1' registered sources in 'NuGet' provider.
DEBUG: 00:00:09.9309465 Source 'https://www.powershellgallery.com/api/v2/' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:11.3593796 Source 'https://www.powershellgallery.com/api/v2/' is validated.
DEBUG: 00:00:11.3647647 Calling 'NuGetRequest'::'GetPackageById', 'PS.B2'.
DEBUG: 00:00:11.5606048 Calling 'HttpClientPackageRepository'::'FindPackagesById', 'PS.B2'.
DEBUG: 00:00:11.5615170 Calling 'NuGetClient'::'FindPackage'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PS.B2'' for ''.
DEBUG: 00:00:11.5884979 Downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PS.B2'&$skip=0&$top=40'.
DEBUG: 00:00:11.8571334 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PS.B2'&$skip=0&$top=40'.
DEBUG: 00:00:11.8592820 '2' packages recevied in the last request.
VERBOSE: Total package yield:'1' for the specified package 'PS.B2'.
DEBUG: 00:00:11.9378512 Completed iterating for 'PS.B2'.
DEBUG: 00:00:11.9651490 Calling 'NuGet'::'GetInstalledPackages' - name='PS.B2', requiredVersion='1.0.0',minimumVersion='', maximumVersion='''.
DEBUG: 00:00:17.7267812 Calling 'NuGet'::'InstallPackage',
'$aHR0cHM6Ly93d3cucG93ZXJzaGVsbGdhbGxlcnkuY29tL2FwaS92Mi8=\UFMuQjI=\MS4wLjA=\aHR0cHM6Ly93d3cucG93ZXJzaGVsbGdhbGxlcnkuY29tL2FwaS92Mi8='.
DEBUG: 00:00:17.7272854 Calling 'NuGetRequest'::'GetPackageByFastpath',
'$aHR0cHM6Ly93d3cucG93ZXJzaGVsbGdhbGxlcnkuY29tL2FwaS92Mi8=\UFMuQjI=\MS4wLjA=\aHR0cHM6Ly93d3cucG93ZXJzaGVsbGdhbGxlcnkuY29tL2FwaS92Mi8='.
DEBUG: 00:00:17.7304730 Calling 'NuGetRequest'::'ResolvePackageSource', 'https://www.powershellgallery.com/api/v2/'.
DEBUG: 00:00:17.7311085 Calling 'NuGetRequest'::'FindRegisteredSource', 'https://www.powershellgallery.com/api/v2/'.
DEBUG: 00:00:17.7316021 Source 'https://www.powershellgallery.com/api/v2/' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:18.2597744 Calling 'HttpClientPackageRepository'::'FindPackage', 'PS.B2'.
DEBUG: 00:00:18.2599138 Calling 'NuGetClient'::'FindPackage'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PS.B2'' for ''.
DEBUG: 00:00:18.2675052 Downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PS.B2'&$skip=0&$top=40'.
DEBUG: 00:00:18.6243653 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PS.B2'&$skip=0&$top=40'.
DEBUG: 00:00:18.6250343 '2' packages recevied in the last request.
DEBUG: 00:00:18.6262622 'Package version' is '1.0.0'.
DEBUG: 00:00:18.6385178 'Request's Destination' is 'C:\Program Files\NuGet\Packages'.
DEBUG: 00:00:18.6459929 Calling 'NuGetClient'::'GetPackageDependencies'.
DEBUG: 00:00:18.6571138 Returning the call 'NuGetClient'::'GetPackageDependencies'.
DEBUG: 00:00:18.6630512 Calling 'NuGetClient'::'InstallPackage'.
VERBOSE: InstallPackage' - name='PS.B2', version='1.0.0',destination='C:\Program Files\NuGet\Packages'
VERBOSE: DownloadPackage' - name='PS.B2', version='1.0.0',destination='C:\Program Files\NuGet\Packages\PS.B2.1.0.0\PS.B2.1.0.0.nupkg',
uri='https://www.powershellgallery.com/api/v2/package/PS.B2/1.0.0'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/PS.B2/1.0.0'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/PS.B2/1.0.0'.
VERBOSE: Completed downloading 'PS.B2'.
VERBOSE: Hash for package 'PS.B2' does not match hash provided from the server.
DEBUG: 00:00:19.6294471 Calling 'NuGetClient'::'InstallPackageLocal'.
VERBOSE: InstallPackageLocal' - name='PS.B2', version='1.0.0',destination='C:\Program Files\NuGet\Packages'
DEBUG: 00:00:19.6295899 C:\Program Files\NuGet\Packages\PS.B2.1.0.0\PS.B2.1.0.0.nupkg
DEBUG: 00:00:19.7741981 Returning the call 'NuGetClient'::'InstallPackageLocal'.
DEBUG: 00:00:19.7792360 Returning the call 'NuGetClient'::'InstallSinglePackage'.

Name                      Version      Source                                 Summary
----                           -------          ------                                     -------
PS.B2                     1.0.0          https://www.powershellgalle... A PowerShell module used to interact with the Backblaze B2 API.

However I cannot find them odule listed in any of my module directories.

After running the same command again I get a System.IO error.

DEBUG: 00:00:00 Calling 'NuGet'::'ResolvePackageSources'.
DEBUG: 00:00:00.0000407 There are '1' registered sources in 'NuGet' provider.
DEBUG: 00:00:00.0000640 Source 'https://www.powershellgallery.com/api/v2/' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:00.5553324 Source 'https://www.powershellgallery.com/api/v2/' is validated.
DEBUG: 00:00:00.5554356 Yielding the package source: '«0»'. «NuGet» «Microsoft.PackageManagement.NuGetProvider.PackageSource»
DEBUG: 00:00:00.5554848 Yielding packge source for https://www.powershellgallery.com/api/v2/ at location
https://www.powershellgallery.com/api/v2/
DEBUG: 00:00:00.5555243 Returning the call 'NuGet'::'ResolvePackageSources'.
DEBUG: 00:00:02.1075866 Calling 'NuGet'::'ResolvePackageSources'.
DEBUG: 00:00:02.1076280 There are '1' registered sources in 'NuGet' provider.
DEBUG: 00:00:02.1076488 Source 'https://www.powershellgallery.com/api/v2/' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:02.4316404 Source 'https://www.powershellgallery.com/api/v2/' is validated.
DEBUG: 00:00:02.4317645 Yielding the package source: '«0»'. «NuGet» «Microsoft.PackageManagement.NuGetProvider.PackageSource»
DEBUG: 00:00:02.4318217 Yielding packge source for https://www.powershellgallery.com/api/v2/ at location
https://www.powershellgallery.com/api/v2/
DEBUG: 00:00:02.4318674 Returning the call 'NuGet'::'ResolvePackageSources'.
DEBUG: 00:00:02.4321165 Calling SearchForPackages. Name='PS.B2'
VERBOSE: Using the provider 'NuGet' for searching packages.
DEBUG: 00:00:02.4337684 PackageProvider::FindPackage with name PS.B2
DEBUG: 00:00:02.4349935 Calling SearchForPackages After Select 1
DEBUG: 00:00:02.4419993 Calling 'NuGet'::'FindPackage' - name='PS.B2', requiredVersion='',minimumVersion='', maximumVersion='''.
DEBUG: 00:00:02.4420842 Iterating 'PS.B2'.
DEBUG: 00:00:02.4423753 There are '1' registered sources in 'NuGet' provider.
DEBUG: 00:00:02.4424493 Source 'https://www.powershellgallery.com/api/v2/' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:03.5431198 Source 'https://www.powershellgallery.com/api/v2/' is validated.
DEBUG: 00:00:03.5432230 Calling 'NuGetRequest'::'GetPackageById', 'PS.B2'.
DEBUG: 00:00:03.7255082 Calling 'HttpClientPackageRepository'::'FindPackagesById', 'PS.B2'.
DEBUG: 00:00:03.7256659 Calling 'NuGetClient'::'FindPackage'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PS.B2'' for ''.
DEBUG: 00:00:03.7259757 Downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PS.B2'&$skip=0&$top=40'.
DEBUG: 00:00:04.0688226 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PS.B2'&$skip=0&$top=40'.
DEBUG: 00:00:04.0695081 '2' packages recevied in the last request.
VERBOSE: Total package yield:'1' for the specified package 'PS.B2'.
DEBUG: 00:00:04.0706424 Completed iterating for 'PS.B2'.
DEBUG: 00:00:04.0865462 Calling 'NuGet'::'GetInstalledPackages' - name='PS.B2', requiredVersion='1.0.0',minimumVersion='', maximumVersion='''.
DEBUG: 00:00:04.1191383 Calling 'GetPackageByFilePath'::'C:\Program Files\NuGet\Packages\PS.B2.1.0.0\PS.B2.1.0.0.nupkg', 'PS.B2.1.0.0'.
DEBUG: 00:00:04.1224382 Calling 'NuGetRequest'::'ResolvePackageSource', 'C:\Program Files\NuGet\Packages\PS.B2.1.0.0\PS.B2.1.0.0.nupkg'.
DEBUG: 00:00:04.1225004 Calling 'NuGetRequest'::'FindRegisteredSource', 'C:\Program Files\NuGet\Packages\PS.B2.1.0.0\PS.B2.1.0.0.nupkg'.
DEBUG: 00:00:04.1225328 Source 'C:\Program Files\NuGet\Packages\PS.B2.1.0.0\PS.B2.1.0.0.nupkg' is not one of the registered sources in 'NuGet'
provider.
DEBUG: 00:00:04.1227978 Source 'C:\Program Files\NuGet\Packages\PS.B2.1.0.0\PS.B2.1.0.0.nupkg' is a file path.
DEBUG: 00:00:04.1356703 System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\dclark\NuGet\Packages'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption,
SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.Directory.EnumerateDirectories(String path)
   at System.Linq.Enumerable.d__16`2.MoveNext()
   at Microsoft.PackageManagement.NuGetProvider.NuGetRequest.GetInstalledPackages(String name, String requiredVersion, String minimumVersion,
String maximumVersion, Boolean minInclusive, Boolean maxInclusive, Boolean terminateFirstFound)
VERBOSE: Skipping installed package PS.B2 1.0.0.

I then ran the command again this time specifying a directory of .\PS.B2

Install-Package "PS.B2" -Source https://www.powershellgallery.com/api/v2/ -Provider NuGet -Verbose -Debug -Destination .\PS.B2

The module as placed in the PS.B2 directory with a name of PS.B2.1.0.0 I then tried the same steps again but this time installing the xPSDesiredStateConfiguration module and it resulted in the same outcome. The module was downloaded but with a name of xPSDesiredStateConfiguration.3.9.0.0.

I’m not sure if that outcome is expected.

Hi Manik,

You can find a copy of the trace file at the URL below.

The output of the command was:

DEBUG: 00:00:00.0002945 Trying provider assembly: C:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.MsiProvider.dll
DEBUG: 00:00:00.0000012 Trying provider assembly: C:\Program
Files\PackageManagement\ProviderAssemblies\nuget_old\2.8.5.204\Microsoft.PackageManagement.NuGetProvider.dll
DEBUG: 00:00:00.0002068 Trying provider assembly: C:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.ArchiverProviders.dll
DEBUG: 00:00:00 Trying provider assembly: C:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.MetaProvider.PowerShell.dll
DEBUG: 00:00:00.0000873 Trying provider assembly: C:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.MsuProvider.dll
DEBUG: 00:00:00.0000961 Trying provider assembly: C:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.CoreProviders.dll
DEBUG: 00:00:00.0054186 Attempting loading of assembly: C:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.CoreProviders.dll
DEBUG: 00:00:00.0055399 Attempting loading of assembly: C:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.ArchiverProviders.dll
DEBUG: 00:00:00.0056525 Attempting loading of assembly: C:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.MetaProvider.PowerShell.dll
DEBUG: 00:00:00.0059165 Attempting loading of assembly: C:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.MsuProvider.dll
DEBUG: 00:00:00.0059635 Attempting loading of assembly: C:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.MsiProvider.dll
DEBUG: 00:00:00.0064521 Attempting loading of assembly: C:\Program
Files\PackageManagement\ProviderAssemblies\nuget_old\2.8.5.204\Microsoft.PackageManagement.NuGetProvider.dll
DEBUG: 00:00:00.0100043 Acquiring providers for assemblyC:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.MsiProvider.dll
DEBUG: 00:00:00.0101029 Acquiring providers for assemblyC:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.MsuProvider.dll
DEBUG: 00:00:00.0103380 Acquiring providers for assemblyC:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.CoreProviders.dll
DEBUG: 00:00:00.0105337 Acquiring providers for assemblyC:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.MetaProvider.PowerShell.dll
DEBUG: 00:00:00.0106195 Acquiring providers for assemblyC:\Program
Files\PackageManagement\ProviderAssemblies\nuget_old\2.8.5.204\Microsoft.PackageManagement.NuGetProvider.dll
DEBUG: 00:00:00.0108864 Acquiring providers for assemblyC:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.ArchiverProviders.dll
DEBUG: 00:00:00.0532578 Registering providers via metaproviders for assembly
Microsoft.PackageManagement.MetaProvider.PowerShell.Internal.PowerShellMetaProvider
DEBUG: 00:00:00.0922607 Initializing provider 'Programs'
DEBUG: 00:00:00.0930286 Initializing provider 'zipfile'
DEBUG: 00:00:00.0934668 Initializing provider 'WebDownloader'
DEBUG: 00:00:00.0935809 Initializing provider 'msu'
DEBUG: 00:00:00.0940661 Initializing provider 'Bootstrap'
DEBUG: 00:00:00.0942957 Initializing provider 'NuGet'
DEBUG: 00:00:00.0945165 Initializing provider 'msi'
DEBUG: 00:00:00.1075210 Provider 'WebDownloader' Initialized
DEBUG: 00:00:00.1075505 Using Downloader Provider WebDownloader
DEBUG: 00:00:00.1544744 Initialize Bootstrapper
DEBUG: 00:00:00.1548629 Calling 'msu::InitializeProvider'
DEBUG: 00:00:00.1548925 Provider 'msu' Initialized
DEBUG: 00:00:00.1549096 Using Package Provider msu
DEBUG: 00:00:00.1550330 Calling 'Programs::InitializeProvider'
DEBUG: 00:00:00.1550511 Provider 'Programs' Initialized
DEBUG: 00:00:00.1550620 Using Package Provider Programs
DEBUG: 00:00:00.1551117 Calling 'msi::InitializeProvider'
DEBUG: 00:00:00.1551382 Provider 'msi' Initialized
DEBUG: 00:00:00.1551500 Using Package Provider msi
DEBUG: 00:00:00.1552430 Provider 'zipfile' Initialized
DEBUG: 00:00:00.1552946 Calling 'NuGet'::'InitializeProvider'.
DEBUG: 00:00:00.1553210 Provider 'NuGet' Initialized
DEBUG: 00:00:00.1553338 Using Package Provider NuGet
DEBUG: 00:00:00.1552613 Using Archiver Provider zipfile
DEBUG: 00:00:00.1556349 Provider 'Bootstrap' Initialized
DEBUG: 00:00:00.1556495 Using Package Provider Bootstrap
DEBUG: 00:00:00.1711241 Calling 'WebDownloader::GetFeatures'
DEBUG: 00:00:00.1711468 Calling 'Bootstrap::GetFeatures'
DEBUG: 00:00:00.1711620 Calling 'msi::GetFeatures'
DEBUG: 00:00:00.1714112 Calling 'Programs::GetFeatures'
DEBUG: 00:00:00.1721374 The provider 'Programs' is imported
DEBUG: 00:00:00.1727318 The provider 'Bootstrap' is imported
DEBUG: 00:00:00.1727800 SUCCESS provider assembly: C:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.CoreProviders.dll
DEBUG: 00:00:00.1728876 The provider 'msi' is imported
DEBUG: 00:00:00.1729227 SUCCESS provider assembly: C:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.MsiProvider.dll
DEBUG: 00:00:00.1745736 Calling 'msu::GetFeatures'
DEBUG: 00:00:00.1746365 The provider 'msu' is imported
DEBUG: 00:00:00.1746352 Calling 'NuGet'::'GetFeatures'.
DEBUG: 00:00:00.1746760 SUCCESS provider assembly: C:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.MsuProvider.dll
DEBUG: 00:00:00.1747833 Calling 'zipfile::GetFeatures'
DEBUG: 00:00:00.1748819 SUCCESS provider assembly: C:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.ArchiverProviders.dll
DEBUG: 00:00:00.1757978 The provider 'NuGet' is imported
DEBUG: 00:00:00.1763085 SUCCESS provider assembly: C:\Program
Files\PackageManagement\ProviderAssemblies\nuget_old\2.8.5.204\Microsoft.PackageManagement.NuGetProvider.dll
DEBUG: 00:00:00.1931246 Calling 'WebDownloader::DownloadFile'
'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409','C:\Users\dclark\AppData\Local\Temp\Microsoft.PackageManagement\28\tmpFile.3384000
1.swidtag.xml','8000','False'
DEBUG: 00:00:00.2229930 Trying to register metaprovider
DEBUG: 00:00:00.2279553 Initializing PowerShell MetaProvider
DEBUG: 00:00:00.3331654 Attempting to load PowerShell Provider Module [C:\Program
Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1]
DEBUG: 00:00:00.5121665 Loaded PowerShell package provider: '[C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1]'.
DEBUG: 00:00:00.5162897 Loaded PowerShell Provider: PowerShellGet
DEBUG: 00:00:00.5183929 Initializing provider 'PowerShellGet'
DEBUG: 00:00:00.5248758 Calling New() : MethodName = 'InitializeProvider'
DEBUG: 00:00:00.5249023 ErrorAction: SilentlyContinue
DEBUG: 00:00:00.5249113 WarningAction: SilentlyContinue
DEBUG: 00:00:00.5304344 INVOKING PowerShell Fn Initialize-Provider with args  that has length 0
DEBUG: 00:00:00.5446519 In PowerShellGet Provider - 'Initialize-Provider'.
DEBUG: 00:00:00.5449265 PowerShell Script 'PSModule' Function 'Initialize-Provider' returns null.
DEBUG: 00:00:00.5461202 Done calling powershell «Initialize-Provider» «PSModule»
DEBUG: 00:00:00.5461569 Provider 'PowerShellGet' Initialized
DEBUG: 00:00:00.5461700 Using Package Provider PowerShellGet
DEBUG: 00:00:00.5512642 Calling New() : MethodName = 'GetFeatures'
DEBUG: 00:00:00.5512885 ErrorAction: SilentlyContinue
DEBUG: 00:00:00.5513006 WarningAction: SilentlyContinue
DEBUG: 00:00:00.5519802 INVOKING PowerShell Fn Get-Feature with args  that has length 0
DEBUG: 00:00:00.5571011 In PowerShellGet Provider - 'Get-Feature'.
DEBUG: 00:00:00.5625459 Done calling powershell «Get-Feature» «PSModule»
DEBUG: 00:00:00.5626205 The provider 'PowerShellGet' is imported
DEBUG: 00:00:00.5635670 SUCCESS provider assembly: C:\Program
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageManagement.MetaProvider.PowerShell.dll
DEBUG: 00:00:00 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0002121 Verbose: True
DEBUG: 00:00:00.0002345 Debug: True
DEBUG: 00:00:00.0002466 Name: PS.B2
DEBUG: 00:00:00.0010733 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1
DEBUG: 00:00:00.0090411 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0247007 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0273065 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0273301 Verbose: True
DEBUG: 00:00:00.0273428 Debug: True
DEBUG: 00:00:00.0273534 Name: PS.B2
DEBUG: 00:00:00.0278601 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1
DEBUG: 00:00:00.0283686 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0305296 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0326193 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0326355 Verbose: True
DEBUG: 00:00:00.0326461 Debug: True
DEBUG: 00:00:00.0326560 Name: PS.B2
DEBUG: 00:00:00.0331583 INVOKING PowerShell Fn Get-DynamicOptions with args Package that has length 1
DEBUG: 00:00:00.0336264 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0361513 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0381425 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0381590 Verbose: True
DEBUG: 00:00:00.0381692 Debug: True
DEBUG: 00:00:00.0381789 Name: PS.B2
DEBUG: 00:00:00.0386202 INVOKING PowerShell Fn Get-DynamicOptions with args Install that has length 1
DEBUG: 00:00:00.0390687 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0408403 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.9955971 Calling SearchForPackages. Name='PS.B2'
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
DEBUG: 00:00:01.0019292 PackageProvider::FindPackage with name PS.B2
DEBUG: 00:00:01.0128878 Calling SearchForPackages After Select 1
DEBUG: 00:00:01.0342578 Calling New() : MethodName = 'FindPackage'
DEBUG: 00:00:01.0358490 ProviderName: PowerShellGet
DEBUG: 00:00:01.0372038 Type: Module
DEBUG: 00:00:01.0404919 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:01.0415108 Debug: True
DEBUG: 00:00:01.0483736 Scope: AllUsers
DEBUG: 00:00:01.0494295 Verbose: True
DEBUG: 00:00:01.0556316 Name: PS.B2
DEBUG: 00:00:01.0573982 INVOKING PowerShell Fn Find-Package with args System.String[], , ,  that has length 4
DEBUG: 00:00:01.1078099 In PowerShellGet Provider - 'Find-Package'.
DEBUG: 00:00:02.0239474 Ping-Endpoint: location=https://go.microsoft.com/fwlink/?LinkID=397631&clcid=0x409, statuscode=200,
resolvedLocation=https://www.powershellgallery.com/api/v2/
DEBUG: 00:00:02.2643222 Ping-Endpoint: location=https://go.microsoft.com/fwlink/?LinkID=622995&clcid=0x409, statuscode=200,
resolvedLocation=https://www.powershellgallery.com/api/v2/items/psscript/
DEBUG: 00:00:02.3878646 OPTION: ProviderName => PowerShellGet
DEBUG: 00:00:02.3888372 OPTION: Type => Module
DEBUG: 00:00:02.3901939 OPTION: MessageResolver => Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:02.3942891 OPTION: Debug => True
DEBUG: 00:00:02.3953593 OPTION: Scope => AllUsers
DEBUG: 00:00:02.4030780 OPTION: Verbose => True
DEBUG: 00:00:02.4044281 OPTION: Name => PS.B2
VERBOSE: The -Repository parameter was not specified.  PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2/' and PackageManagementProvider is 'NuGet'.
DEBUG: 00:00:02.4702550 PackageProvider::FindPackage with name PS.B2
DEBUG: 00:00:02.4797381 Calling 'NuGet'::'FindPackage' - name='PS.B2', requiredVersion='',minimumVersion='', maximumVersion='''.
DEBUG: 00:00:02.4829503 Iterating 'PS.B2'.
DEBUG: 00:00:02.5001337 Calling 'NuGetRequest'::'RegisteredPackageSources', 'C:\Users\dclark\AppData\Roaming\NuGet\nuget.config'.
DEBUG: 00:00:02.5023628 Loading a configuration from file 'C:\Users\dclark\AppData\Roaming\NuGet\nuget.config'.
DEBUG: 00:00:02.5046105 Loaded a configuration from file 'C:\Users\dclark\AppData\Roaming\NuGet\nuget.config'.
DEBUG: 00:00:02.5100460 There are '1' registered sources in 'NuGet' provider.
DEBUG: 00:00:02.5122197 Source 'https://www.powershellgallery.com/api/v2/' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:03.0070692 Source 'https://www.powershellgallery.com/api/v2/' is validated.
DEBUG: 00:00:03.0125180 Calling 'NuGetRequest'::'GetPackageById', 'PS.B2'.
DEBUG: 00:00:03.1977519 Calling 'HttpClientPackageRepository'::'FindPackagesById', 'PS.B2'.
DEBUG: 00:00:03.2002930 Calling 'NuGetClient'::'FindPackage'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PS.B2'' for ''.
DEBUG: 00:00:03.2230720 Downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PS.B2'&$skip=0&$top=40'.
DEBUG: 00:00:03.5988556 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PS.B2'&$skip=0&$top=40'.
DEBUG: 00:00:03.6279237 '2' packages recevied in the last request.
VERBOSE: Total package yield:'1' for the specified package 'PS.B2'.
DEBUG: 00:00:03.6765119 Completed iterating for 'PS.B2'.
DEBUG: 00:00:03.8004661 Done calling powershell «Find-Package» «PSModule»
DEBUG: 00:00:03.8217593 Calling New() : MethodName = 'GetInstalledPackages'
DEBUG: 00:00:03.8225502 ProviderName: PowerShellGet
DEBUG: 00:00:03.8236376 Type: Module
DEBUG: 00:00:03.8275555 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:03.8285138 Debug: True
DEBUG: 00:00:03.8337321 Scope: AllUsers
DEBUG: 00:00:03.8344416 Verbose: True
DEBUG: 00:00:03.8392313 Name: PS.B2
DEBUG: 00:00:03.8405880 INVOKING PowerShell Fn Get-InstalledPackage with args PS.B2, 1.0.0, ,  that has length 4
DEBUG: 00:00:03.8479639 In PowerShellGet Provider - 'Get-InstalledPackage'.
DEBUG: 00:00:03.8498810 OPTION: ProviderName => PowerShellGet
DEBUG: 00:00:03.8513167 OPTION: Type => Module
DEBUG: 00:00:03.8565857 OPTION: MessageResolver => Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:03.8575443 OPTION: Debug => True
DEBUG: 00:00:03.8618737 OPTION: Scope => AllUsers
DEBUG: 00:00:03.8630366 OPTION: Verbose => True
DEBUG: 00:00:03.8684522 OPTION: Name => PS.B2
WARNING: Cannot bind argument to parameter 'name' because it is an empty string.
DEBUG: 00:00:06.6123972 MSG:ScriptStackTrace «   at
System.Management.Automation.ParameterBinderBase.ValidateNullOrEmptyArgument(CommandParameterInternal parameter, CompiledCommandParameter
parameterMetadata, Type argumentType, Object parameterValue, Boolean recurseIntoCollections)
   at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter
parameterMetadata, ParameterBindingFlags flags)
   at System.Management.Automation.CmdletParameterBinderController.BindParameter(CommandParameterInternal argument,
MergedCompiledCommandParameter parameter, ParameterBindingFlags flags)
   at System.Management.Automation.CmdletParameterBinderController.BindParameter(UInt32 parameterSets, CommandParameterInternal argument,
MergedCompiledCommandParameter parameter, ParameterBindingFlags flags)
   at System.Management.Automation.CmdletParameterBinderController.BindParameters(UInt32 parameterSets, Collection`1 arguments)
   at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection`1 arguments)
   at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1 arguments)
   at System.Management.Automation.CommandProcessor.BindCommandLineParameters()
   at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues)
   at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)
   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean
enumerate)»
DEBUG: 00:00:06.6213347 Done calling powershell «Get-InstalledPackage» «PSModule»
VERBOSE: Skipping installed module PS.B2 1.0.0.

Hi Dakota,

Thanks for sharing the Install-Module traces. From the traces, I found that Author value is empty in C:\Program Files\WindowsPowerShell\Modules\posh-git\0.5.0.2015\PSGetModuleInfo.xml, that is why you are getting the error “Cannot bind argument to parameter ‘name’ because it is an empty string.”.

ParameterBinding Information: 0 :             BIND NAMED cmd line args [New-Entity]
ParameterBinding Information: 0 :                 BIND arg [] to parameter [name]
ParameterBinding Information: 0 :                     Executing DATA GENERATION metadata: [System.Management.Automation.ArgumentTypeConverterAttribute]
ParameterBinding Information: 0 :                         result returned from DATA GENERATION: 
ParameterBinding Information: 0 :                     COERCE arg to [System.String]
ParameterBinding Information: 0 :                         Parameter and arg types the same, no coercion is needed.
ParameterBinding Information: 0 :                     ERROR: Argument cannot be an empty string
ParameterBinding Information: 0 :             BIND NAMED cmd line args [Get-ProviderName]
ParameterBinding Information: 0 :                 BIND arg [@{Name=posh-git; Version=0.5.0.2015; Type=Module; Description=; Author=; CompanyName=; Copyright=; PublishedDate=; LicenseUri=; ProjectUri=; IconUri=; Tags=System.Collections.ArrayList; Includes=System.Collections.Hashtable; PowerShellGetFormatVersion=; ReleaseNotes=; Dependencies=System.Collections.ArrayList; RepositorySourceLocation=https://www.powershellgallery.com/api/v2/; Repository=PSGallery; PackageManagementProvider=NuGet; AdditionalMetadata=System.Collections.Hashtable; InstalledLocation=C:\Program Files\WindowsPowerShell\Modules\posh-git\0.5.0.2015}] to parameter [PSCustomObject]
  1. Please share the contents of C:\Program Files\WindowsPowerShell\Modules\posh-git folder.
  2. Also let us know whether you have modified the contents of C:\Program Files\WindowsPowerShell\Modules\posh-git\0.5.0.2015\PSGetModuleInfo.xml file, if not, could you please uninstall the posh-git module then re-install it and check the values of below properties?
    • Description
    • Author
    • CompanyName
    • Copyright
    • PublishedDate
    • InstalledDate
    • UpdatedDate
    • LicenseUri
    • ProjectUri
    • IconUri
    • Tags
Uninstall-Module –Name posh-git –Verbose
# If you can not uninstall it using Uninstall-Module cmdlet, manually delete/move the C:\Program Files\WindowsPowerShell\Modules\posh-git folder.

Install-Module –Name posh-git –RequiredVersion 0.5.0.2015 –Verbose –Debug
Get-InstalledModule –Name posh-git
Get-InstalledModule –Name posh-git | fl * -force
  1. Now, try again to install the PS.B2 module. Let us know if the problem is resolved.
Install-Module –Name PS.B2 –Force –Verbose –Debug

Fix: In PSModule.psm1 file and in New-SoftwareIdentityFromPSGetItemInfo function, add “-and $psgetItemInfo.Author.ToString()” in if($psgetItemInfo.Author) as mentioned below to resolve this issue on your machine. We will add this check in the PowerShellGet module as well.

    if($psgetItemInfo.Author -and $psgetItemInfo.Author.ToString())
    {
        $entities.Add( (New-Entity -Name $psgetItemInfo.Author -Role 'author') )
    }

Thanks,
Manikyam Bavandla [MSFT]
PowerShell Team

Hi Manik,

Thanks for pointing out the posh-git module xml file, that was the issue!
I’ve gone ahead and updated it to the latest version (my version is an old holdover from PS v3) and the issue is gone. I can install modules without error now.

Thank you so much for your assistance on this issue Manik!