none
import module psake error RRS feed

  • Question

  • Hi I am new to Powershell. I am following through with Pluralsight Powershell course. I downloaded Psake and extracted the files into  c:\windows\system32\windowsPowershell\v1\Modules\Psake   and C:\Users\user\Documents\WindowsPowerShell\Modules

     (my psmodulepath). But when I try to run:import-module psake; I get error:" Import-Module : The specified module 'psake' was not loaded because no valid module file was found in any module ". I am running PS as admin. I am using Windows 7 home premium 64bit. I can import other modules in my env. path e..g. PSDiagnostics. Psake appears in  available modules:

    Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules\psake
    ModuleType Name                                ExportedCommands                                                      
    ---------- ----                                ----------------                                                      
    Script     psake                               {Invoke-psake, Invoke-Task, Get-PSakeScriptTasks, Task...}            
    Script     psake                               {Invoke-psake, Invoke-Task, Get-PSakeScriptTasks, Task...}  

    The instructor said we need to unlock the files/folder before extracting by right clicking downloaded folder and select properties and clicking unlock button. This feature is not present in my windows. And I am thinking this may be the cause for the error.

    There are 3 environment PS paths.

    PS C:\Windows\system32> $env:PSModulePath
    C:\Users\user\Documents\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules\;

    C:\Program Files (x86)\Microsoft SQL Server\120\Tools\PowerShell\Modules\

    Please help


    Wednesday, November 20, 2019 1:17 AM

Answers

  • at last I was able to make env path work by copying the contents of src folder and dumping them int the psake folder like this: home\windowspowershel\modules\psake \ contents of src folder.

    Then  PS > import-module psake 

     --------- works

    • Marked as answer by kobosh3 Saturday, November 23, 2019 12:35 AM
    Saturday, November 23, 2019 12:35 AM

All replies

  • this worked but i don't know the reason:  Import-Module C:\Users\user\Documents\WindowsPowerShell\modules\psake\psake-master\src\psake.psm1
    • Marked as answer by kobosh3 Wednesday, November 20, 2019 11:33 PM
    • Unmarked as answer by kobosh3 Saturday, November 23, 2019 12:35 AM
    Wednesday, November 20, 2019 11:33 PM
  • at last I was able to make env path work by copying the contents of src folder and dumping them int the psake folder like this: home\windowspowershel\modules\psake \ contents of src folder.

    Then  PS > import-module psake 

     --------- works

    • Marked as answer by kobosh3 Saturday, November 23, 2019 12:35 AM
    Saturday, November 23, 2019 12:35 AM