FriedrichWeinmann / FileType

Module to validate filetypes
MIT License
6 stars 2 forks source link

Can't install on PowerShell Core 6 / PowerShell 7 preview #8

Open sba923 opened 4 years ago

sba923 commented 4 years ago

Something related to PSFramework causes Install-Module FileType to fail:

PS 6.2.3 C:/WINDOWS/system32> install-module filetype -force -verbose                                                   VERBOSE: Acquiring providers for assembly: C:\program files\powershell\6\Modules\PackageManagement\coreclr\netstandard2.0\Microsoft.PackageManagement.MetaProvider.PowerShell.dll                                                               VERBOSE: Acquiring providers for assembly: C:\program files\powershell\6\Modules\PackageManagement\coreclr\netstandard2.0\Microsoft.PackageManagement.ArchiverProviders.dll                                                                     VERBOSE: Acquiring providers for assembly: C:\program files\powershell\6\Modules\PackageManagement\coreclr\netstandard2.0\Microsoft.PackageManagement.NuGetProvider.dll                                                                         VERBOSE: Acquiring providers for assembly: C:\program files\powershell\6\Modules\PackageManagement\coreclr\netstandard2.0\Microsoft.PackageManagement.CoreProviders.dll                                                                         VERBOSE: Using the provider 'PowerShellGet' for searching packages.                                                     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'.VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='filetype'' for ''.       VERBOSE: Total package yield:'1' for the specified package 'filetype'.                                                  VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.                                        VERBOSE: The specified Location is 'https://www.poshtestgallery.com/api/v2/' and PackageManagementProvider is 'NuGet'.  VERBOSE: Searching repository 'https://www.poshtestgallery.com/api/v2/FindPackagesById()?id='filetype'' for ''.         VERBOSE: Total package yield:'0' for the specified package 'filetype'.                                                  VERBOSE: Performing the operation "Install-Module" on target "Version '1.0.2' of module 'FileType'".                    VERBOSE: The installation scope is specified to be 'CurrentUser'.                                                       VERBOSE: The specified module will be installed in 'C:\Users\steph\OneDrive\Documents\PowerShell\Modules'.              VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.                                    VERBOSE: Downloading module 'FileType' with version '1.0.2' from the repository 'https://www.powershellgallery.com/api/v2/'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='FileType'' for ''.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PSFramework'' for ''.
VERBOSE: InstallPackage' - name='PSFramework', version='1.0.35',destination='C:\Users\steph\AppData\Local\Temp\1674069492'
VERBOSE: DownloadPackage' - name='PSFramework', version='1.0.35',destination='C:\Users\steph\AppData\Local\Temp\1674069492\PSFramework.1.0.35\PSFramework.1.0.35.nupkg', uri='https://www.powershellgallery.com/api/v2/package/PSFramework/1.0.35'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/PSFramework/1.0.35'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/PSFramework/1.0.35'.
VERBOSE: Completed downloading 'PSFramework'.
VERBOSE: InstallPackageLocal' - name='PSFramework', version='1.0.35',destination='C:\Users\steph\AppData\Local\Temp\1674069492'
VERBOSE: InstallPackage' - name='FileType', version='1.0.2',destination='C:\Users\steph\AppData\Local\Temp\1674069492'
VERBOSE: DownloadPackage' - name='FileType', version='1.0.2',destination='C:\Users\steph\AppData\Local\Temp\1674069492\FileType.1.0.2\FileType.1.0.2.nupkg', uri='https://www.powershellgallery.com/api/v2/package/FileType/1.0.2'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/FileType/1.0.2'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/FileType/1.0.2'.
VERBOSE: Completed downloading 'FileType'.
VERBOSE: InstallPackageLocal' - name='FileType', version='1.0.2',destination='C:\Users\steph\AppData\Local\Temp\1674069492'
VERBOSE: Validating the 'PSFramework' module contents under 'C:\Users\steph\AppData\Local\Temp\1674069492\PSFramework.1.0.35' path.
VERBOSE: Test-ModuleManifest successfully validated the module manifest file 'C:\Users\steph\AppData\Local\Temp\1674069492\PSFramework.1.0.35'.
VERBOSE: Validating the authenticode signature and publisher of the catalog file or module manifest file of the module 'PSFramework'.
VERBOSE: Catalog file 'PSFramework.cat' is not found in the contents of the module 'PSFramework' being installed.
VERBOSE: For publisher validation, current module 'PSFramework' with version '1.0.35' with publisher name '' from root certificate authority ''. Is this module signed by Microsoft: 'False'.
VERBOSE: For publisher validation, using the previously-installed module 'PSFramework' with version '1.0.35' under 'C:\Users\steph\OneDrive\Documents\PowerShell\Modules\PSFramework\1.0.35' with publisher name '' from root certificate authority ''. Is this module signed by Microsoft: 'False'.
VERBOSE: Checking for possible command collisions for the module 'PSFramework' commands.
VERBOSE: Installing the dependency module 'PSFramework' with version '1.0.35' for the module 'FileType'.
PackageManagement\Install-Package : Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
At C:\program files\powershell\6\Modules\PowerShellGet\PSModule.psm1:9508 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (Microsoft.PowerShel\u2026lets.InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : System.FormatException,Microsoft.PowerShell.Commands.RemoveItemCommand,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
FriedrichWeinmann commented 4 years ago

Can't reproduce it. Exactly what version of PackageManagement and PowerShellGet are you using?

sba923 commented 4 years ago
PS 7.0.0-preview.3 C:/Users/steph> (get-module PackageManagement).version.Tostring()
1.4.3                                                                                                                   
PS 7.0.0-preview.3 C:/Users/steph> (get-module PowerShellGet).version.tostring()
2.2                                                                                                                     
FriedrichWeinmann commented 4 years ago

Alright, updated to just those versions and tried again: Still works without issues :( Does installing the PSFramework directly work for you?

Install-Module PSFramework -Force
sba923 commented 4 years ago

Nope....

PS 7.0.0-preview.3 C:/Windows/System32> Install-Module PSFramework -Force -verbose                                      VERBOSE: Acquiring providers for assembly: C:\program files\powershell\7-preview\Modules\PackageManagement\coreclr\netstandard2.0\Microsoft.PackageManagement.ArchiverProviders.dll                                                             VERBOSE: Acquiring providers for assembly: C:\program files\powershell\7-preview\Modules\PackageManagement\coreclr\netstandard2.0\Microsoft.PackageManagement.MetaProvider.PowerShell.dll                                                       VERBOSE: Acquiring providers for assembly: C:\program files\powershell\7-preview\Modules\PackageManagement\coreclr\netstandard2.0\Microsoft.PackageManagement.CoreProviders.dll                                                                 VERBOSE: Acquiring providers for assembly: C:\program files\powershell\7-preview\Modules\PackageManagement\coreclr\netstandard2.0\Microsoft.PackageManagement.NuGetProvider.dll                                                                 VERBOSE: Using the provider 'PowerShellGet' for searching packages.                                                     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.poshtestgallery.com/api/v2/' and PackageManagementProvider is 'NuGet'.  VERBOSE: Searching repository 'https://www.poshtestgallery.com/api/v2/FindPackagesById()?id='PSFramework'' for ''.      VERBOSE: Total package yield:'0' for the specified package 'PSFramework'.
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'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PSFramework'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'PSFramework'.
VERBOSE: Performing the operation "Install-Module" on target "Version '1.0.35' of module 'PSFramework'".
VERBOSE: The installation scope is specified to be 'CurrentUser'.
VERBOSE: The specified module will be installed in 'C:\Users\steph\OneDrive\Documents\PowerShell\Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'PSFramework' with version '1.0.35' from the repository 'https://www.powershellgallery.com/api/v2/'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PSFramework'' for ''.
VERBOSE: InstallPackage' - name='PSFramework', version='1.0.35',destination='C:\Users\steph\AppData\Local\Temp\175639040'
VERBOSE: DownloadPackage' - name='PSFramework', version='1.0.35',destination='C:\Users\steph\AppData\Local\Temp\175639040\PSFramework.1.0.35\PSFramework.1.0.35.nupkg', uri='https://www.powershellgallery.com/api/v2/package/PSFramework/1.0.35'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/PSFramework/1.0.35'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/PSFramework/1.0.35'.
VERBOSE: Completed downloading 'PSFramework'.
VERBOSE: InstallPackageLocal' - name='PSFramework', version='1.0.35',destination='C:\Users\steph\AppData\Local\Temp\175639040'
VERBOSE: Validating the 'PSFramework' module contents under 'C:\Users\steph\AppData\Local\Temp\175639040\PSFramework.1.0.35' path.
VERBOSE: Test-ModuleManifest successfully validated the module manifest file 'C:\Users\steph\AppData\Local\Temp\175639040\PSFramework.1.0.35'.
VERBOSE: Validating the authenticode signature and publisher of the catalog file or module manifest file of the module 'PSFramework'.
VERBOSE: Catalog file 'PSFramework.cat' is not found in the contents of the module 'PSFramework' being installed.
VERBOSE: For publisher validation, current module 'PSFramework' with version '1.0.35' with publisher name '' from root certificate authority ''. Is this module signed by Microsoft: 'False'.
VERBOSE: For publisher validation, using the previously-installed module 'PSFramework' with version '1.0.35' under 'C:\Users\steph\OneDrive\Documents\PowerShell\Modules\PSFramework\1.0.35' with publisher name '' from root certificate authority ''. Is this module signed by Microsoft: 'False'.
VERBOSE: Checking for possible command collisions for the module 'PSFramework' commands.
PackageManagement\Install-Package : Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
At C:\program files\powershell\7-preview\Modules\PowerShellGet\PSModule.psm1:9683 char:34
+ ... talledPackages = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (Microsoft.PowerShel…lets.InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : System.FormatException,Microsoft.PowerShell.Commands.RemoveItemCommand,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage