Local Group policy module issue

I am new to powershell, I would like to update some of the local group policies using powershell. i am trying to import "policyfileeditor’ module and getting this error.

Any help will be highly appreciated.

PS C:> Import-Module -Name PolicyFileEditor

Import-Module : The specified module ‘PolicyFileEditor’ was not loaded because no valid module file was found in any

module directory.

At line:1 char:1

  • Import-Module -Name PolicyFileEditor

  • 
    
  • CategoryInfo : ResourceUnavailable: (PolicyFileEditor:String) [Import-Module], FileNotFoundException

  • FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

This is not a default PS module. Install-Module, should just hit the MS PowerShellGallery to get it, but some folks have had issues with doing it that way.

You have to download and install it to use it.

Try this… Run as admin (the noisy way to see all of what is going on)

 

Find-Module -Name PolicyFileEditor

Version    Name                                Type       Repository           Description
-------    ----                                ----       ----------           -----------
3.0.1      PolicyFileEditor                    Module     PSGallery            Commands and....

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

Now, in some cases, a few have had issues even doing this this way on some systems, which often means this is an environmental issue.

Thank you for the quick reply.

I downloaded policyfileeditor.3.0.0.nupkg and put it in my C:\temp but still was unable to import it.

Import-Module -Name c:\temp\PolicyFileEditor

All modules must be in the defined PS module path. because that is where PS will only look.

$env:PSModulePath
# https://docs.microsoft.com/en-us/powershell/developer/module/modifying-the-psmodulepath-installation-path

If you put it somewhere else you have to fully qualify the path to that location.