Installing from PSGallery

Can anyone offer me insight into why I cannot get PolicyFileEditor installed? I have added NuGet as a package provider and set PSGallery to be trusted. The install output appears to work, but the module remain unavailable.

PS C:\WINDOWS\system32> Install-Module -Name PolicyFileEditor -force -verbose
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.powershellgalle… and
PackageManagementProvider is ‘NuGet’.
VERBOSE: Searching repository
'https://www.powershellgalle… for ‘’.
VERBOSE: Total package yield:‘1’ for the specified package ‘PolicyFileEditor’.
VERBOSE: Performing the operation “Install-Module” on target “Version ‘3.0.1’ of module
‘PolicyFileEditor’”.
VERBOSE: The installation scope is specified to be ‘AllUsers’.
VERBOSE: The specified module will be installed in ‘C:\Program Files\WindowsPowerShell\Modules’.
VERBOSE: The specified Location is ‘NuGet’ and PackageManagementProvider is ‘NuGet’.
VERBOSE: Downloading module ‘PolicyFileEditor’ with version ‘3.0.1’ from the repository
https://www.powershellgalle….
VERBOSE: Searching repository
https://www.powershellgalle… for ‘’.
VERBOSE: InstallPackage’ - name=‘PolicyFileEditor’,
version=‘3.0.1’,destination=‘C:\Users\Steven\AppData\Local\Temp\223968398’
VERBOSE: DownloadPackage’ - name=‘PolicyFileEditor’,
version=‘3.0.1’,destination=‘C:\Users\Steven\AppData\Local\Temp\223968398\PolicyFileEditor\PolicyFi
leEditor.nupkg’, uri='https://www.powershellgalle…
VERBOSE: Downloading 'https://www.powershellgalle….
VERBOSE: Completed downloading
https://www.powershellgalle….
VERBOSE: Completed downloading ‘PolicyFileEditor’.
VERBOSE: Hash for package ‘PolicyFileEditor’ does not match hash provided from the server.
VERBOSE: InstallPackageLocal’ - name=‘PolicyFileEditor’,
version=‘3.0.1’,destination=‘C:\Users\Steven\AppData\Local\Temp\223968398’
VERBOSE: Catalog file ‘PolicyFileEditor.cat’ is not found in the contents of the module
‘PolicyFileEditor’ being installed.
VERBOSE: Valid authenticode signature found in the file ‘PolicyFileEditor.psd1’ for the module
‘PolicyFileEditor’.

No files are added to C:\Program Files\WindowsPowerShell\Modules, but the install is for all users, right?

It does not show up under Get-Module and the commands are unavailable.

For reference: https://www.powershellgallery.com/packages/PolicyFileEditor/3.0.0

At a guess, I suppose I’d consider file permissions. Are you running this as an account with permission to create files there?

@DonJones - Wouldn’t it throw error if so ?

You are not saying what OS you are on or what PS version you are using or how you are using PS, elevated or not, if you are below PSv5, you should install PowerShellGet, which is the package manager for Windows vs native Nuget.

PackageManagement PowerShell Modules Preview - March 2016 https://www.microsoft.com/en-us/download/details.aspx?id=51451

PSGet is part of Win 10 by default, thus no need to install nuget or chocolaty. The installer, takes care of the Nuget stuff for you.

I have seen this, once or twice from different folks. Give it a shot this way…

# be sure to update your PSGet version as well. 1x is the been replaced with 2x
get-module -Name '*get*'

ModuleType Version    Name            ExportedCommands                                                                                                                   
---------- -------    ----            ----------------                                                                                                                   
Script     2.0.0      PowerShellGet   {Find-Command, Find-DscResource,...

Find-Module -Name PowerShellGet | 
Save-Module -Path "$env:USERPROFILE\Documents\WindowsPowerShell\Modules" -Verbose -Force -WhatIf
Install-Module -Name PolicyFileEditor -Verbose -Force

Find-Module -Name PolicyFileEditor | 
Save-Module -Path "$env:USERPROFILE\Documents\WindowsPowerShell\Modules" -Verbose -Force -WhatIf
Install-Module -Name PolicyFileEditor -Verbose -Force

I am using Windows 10 Pro.

I tried to follow Postanote’s advice. No joy with PolicyFileEditor or upgrading PowerShellGet either through PowerShell or by the msi file.

PS C:\WINDOWS\system32> Install-Module -Name PackageManagement -RequiredVersion 1.1.7.2
PS C:\WINDOWS\system32> get-module

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint...
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable,...
Binary     1.0.0.1    PackageManagement                   {Find-Package, Find-PackageProvider, G...
Script     1.0.0.1    PowerShellGet                       {Find-Command, Find-DscResource, Find-...
Script     1.2        PSReadline                          {Get-PSReadlineKeyHandler, Get-PSReadl...


PS C:\WINDOWS\system32>

When I try and install the msi I get:

I meet those requirements…

I tried to follow the directions here (http://shaulov.us/2018/01/13/upgrading-powershellget-1-0-0-1-to-the-latest-version/) and that just brought me close to a backup restore. I do not have the same folders in package management though as the example on this page. I have no 1.6.0 and I have 1.0.0.0 and 1.0.0.1. Regarding PowerShellGet, removing the folder just makes PSGet not installed.

Sigh.

Regarding the actual goal, I wonder if the line saying the file does not match the hash provided by the server is related to the problem.

PS C:\WINDOWS\system32> Install-Module -Name PolicyFileEditor -verbose -force
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='PolicyFileEditor'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'PolicyFileEditor'.
VERBOSE: Performing the operation "Install-Module" on target "Version '3.0.1' of module
'PolicyFileEditor'".
VERBOSE: The installation scope is specified to be 'AllUsers'.
VERBOSE: The specified module will be installed in 'C:\Program Files\WindowsPowerShell\Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'PolicyFileEditor' with version '3.0.1' from the repository
'https://www.powershellgallery.com/api/v2'.
VERBOSE: Searching repository
'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PolicyFileEditor'' for ''.
VERBOSE: InstallPackage' - name='PolicyFileEditor',
version='3.0.1',destination='C:\Users\Steven\AppData\Local\Temp\25650263'
VERBOSE: DownloadPackage' - name='PolicyFileEditor',
version='3.0.1',destination='C:\Users\Steven\AppData\Local\Temp\25650263\PolicyFileEditor\PolicyFil
eEditor.nupkg', uri='https://www.powershellgallery.com/api/v2/package/PolicyFileEditor/3.0.1'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/PolicyFileEditor/3.0.1'.
VERBOSE: Completed downloading
'https://www.powershellgallery.com/api/v2/package/PolicyFileEditor/3.0.1'.
VERBOSE: Completed downloading 'PolicyFileEditor'.
VERBOSE: Hash for package 'PolicyFileEditor' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='PolicyFileEditor',
version='3.0.1',destination='C:\Users\Steven\AppData\Local\Temp\25650263'
VERBOSE: Catalog file 'PolicyFileEditor.cat' is not found in the contents of the module
'PolicyFileEditor' being installed.
VERBOSE: Valid authenticode signature found in the file 'PolicyFileEditor.psd1' for the module
'PolicyFileEditor'.