This topic contains 4 replies, has 3 voices, and was last updated by
September 24, 2018 at 8:49 pm #112535ParticipantPoints: 0Rank: 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
At line:1 char:1
+ Import-Module -Name PolicyFileEditor
+ CategoryInfo : ResourceUnavailable: (PolicyFileEditor:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
September 25, 2018 at 12:24 am #112552ParticipantPoints: 37Rank: 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.
September 25, 2018 at 2:27 pm #112588ParticipantPoints: 0Rank: 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.
September 25, 2018 at 3:28 pm #112591ParticipantPoints: 9Rank: Member
Import-Module -Name c:\temp\PolicyFileEditor
September 25, 2018 at 3:28 pm #112592ParticipantPoints: 37Rank: 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.