microsoft / powerbi-powershell

PowerShell community for Microsoft PowerBI. Here you will find resources and source for PowerShell modules targeting PowerBI.
MIT License
349 stars 121 forks source link

Unable to install cmdlets. "Unable to read file...to calculate its hash." #247

Open ericthomas1 opened 4 years ago

ericthomas1 commented 4 years ago

Hello,

Running through the installation instructions...link

PackageManagement\Install-Package : Unable to read file C:\Users\me\AppData\Local\Temp\442391038\MicrosoftPowerBIM
gmt.Data\lib\netstandard2.0\Microsoft.PowerBI.Common.Api.dll to calculate its hash.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package],
   Exception
    + FullyQualifiedErrorId : UnableToReadFileToHash,Microsoft.PowerShell.Commands.TestFileCatalogCommand,Microsoft.Po
   werShell.PackageManagement.Cmdlets.InstallPackage

I have .NET 4.7.2 installed already...

image

How can I get past this?

Thank you

ericthomas1 commented 4 years ago

Here is what worked so far. Install-Module -Name MicrosoftPowerBIMgmt -Force -SkipPublisherCheck

Could use some insights on which flag made this work.

Thank you

ericthomas1 commented 4 years ago

Hello.

Please check the cmdlet publisher sig/hash of the MicrosoftPowerBIMgmt in PSGallery. It appears it is incorrect. Would like to hear back on this issue.

Thank you

CattieCat commented 3 years ago

@ericthomas1 what was your powershell version? We are following code signing process and will revisit it based on https://docs.microsoft.com/en-us/powershell/scripting/gallery/concepts/publishing-guidelines?view=powershell-7.1#sign-your-code

ericthomas1 commented 3 years ago

I'm not sure what version of PowerShell I was running 6-7 months ago when I reported this. At the moment, I'm running 5.1.18362.1171. I don't specifically remember updating, but not sure if any programs/plugins/extensions/etc. have updated PowerShell automatically/in the background since 8/2020.