Local Group policy module issue

Welcome Forums General PowerShell Q&A Local Group policy module issue

This topic contains 4 replies, has 3 voices, and was last updated by

 
Participant
3 weeks, 6 days ago.

  • Author
    Posts
  • #112535

    Participant
    Points: 0
    Rank: Member

    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

  • #112552

    Participant
    Points: 37
    PublishedHelping Hand
    Rank: Member

    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.

    • #112588

      Participant
      Points: 0
      Rank: Member

      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.

  • #112591
    js

    Participant
    Points: 9
    Rank: Member
    Import-Module -Name c:\temp\PolicyFileEditor
  • #112592

    Participant
    Points: 37
    PublishedHelping Hand
    Rank: Member

    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.

You must be logged in to reply to this topic.