Import-module pskpi error

Apr 27, 2013 at 3:42 AM
when i was trying to import the module to ps,
i got the error like this
also i have tryed to replace the psm1 file in the below link
https://pspki.codeplex.com/workitem/30
Import-Module : The module to process 'PSPKI.psm1', listed in field 'ModuleToProcess' of module manifest 'C:\Windows\sy
stem32\WindowsPowerShell\v1.0\Modules\PSPKI\PSPKI.psd1' was not processed because no valid module was found in any modu
le directory.
At line:24 char:34
+                     Import-Module <<<<  $_.Name -ErrorAction SilentlyContinue
    + CategoryInfo          : ResourceUnavailable: (PSPKI:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand__
Apr 27, 2013 at 6:39 AM
sorry ,i have mistyped pspki for pskpi。
OMG!!!
Apr 27, 2013 at 7:00 AM
Edited Apr 29, 2013 at 5:57 AM
HI,Guys
you can modify the psm1file in the line 202 and 203 like below,
take attention for the #, pls take out the
# export module members
# Export-ModuleMember 朏unction @(Get-Command 朚odule $ExecutionContext.SessionState.Module | Where-Object {$RestrictedFunctions -notcontains $_.Name})
# Export-ModuleMember -Alias @(Get-Command 朚odule $ExecutionContext.SessionState.Module)
Coordinator
Apr 27, 2013 at 7:09 AM
lvnhjj wrote:
HI,Guys
you can modify the psm1file in the line 202 and 203 like below,
take attention for the "#"

export module members

Export-ModuleMember 朏unction @(Get-Command 朚odule $ExecutionContext.SessionState.Module | Where-Object {$RestrictedFunctions -notcontains $_.Name})

Export-ModuleMember -Alias @(Get-Command 朚odule $ExecutionContext.SessionState.Module)

why do I need to change there anything? I think, Export-ModuleMember commands are executed correctly.
Apr 29, 2013 at 5:53 AM
Hi,Camelot.
because when i was trying to import module pspki
i get the error like below.
i think the powershell can not regonize those tow strange command . 1 朏unction 2 朚odule two
Although i have corrected to function and module , it didn't work.
so, i have to make the "#" before those two line to annotate it .
  • Export-ModuleMember <<<< 朏unction @(Get-Command 朚odule $ExecutionContext.SessionState.Module | Where-Object {$Rest
    rictedFunctions -notcontains $_.Name})
    • CategoryInfo : InvalidArgument: (:) [Export-ModuleMember], ParameterBindingException
    • FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.ExportModuleMemberCommand
  • Export-ModuleMember -Alias @(Get-Command <<<< 朚odule $ExecutionContext.SessionState.Module)
    • CategoryInfo : ObjectNotFound: (朚odule:String) [Get-Command], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand
Coordinator
Apr 29, 2013 at 9:47 AM
looks like you have strange encoding issue. Try to fix these weird characters with normal ones.