Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem running powershell scripts, such as #16

Open
alturium opened this issue Jun 5, 2017 · 1 comment
Open

Problem running powershell scripts, such as #16

alturium opened this issue Jun 5, 2017 · 1 comment

Comments

@alturium
Copy link

alturium commented Jun 5, 2017

Hi,

Thanks ahead of time for any help. This is not a microcafe issue per se, but I'm new to powershell and receive the errors below when invoking the .ps1 scripts from a PS cmd line.

When running the Build-Microservices.ps1 (after invoking powershell via command line), received the following error message (which is probably due to the powershell setup on my machine):

`Import-Module : The specified module '\Invoke-MsBuild.psm1' was not loaded because no valid module
file was found in any module directory.
At D:\dev\projects\aspnet_core_akka_net\microcafe\Build-MicroServices.ps1:4 char:14

  • Import-Module <<<< -Name "$PSScriptRoot\Invoke-MsBuild.psm1"
    • CategoryInfo : ResourceUnavailable: (\Invoke-MsBuild.psm1:String) [Import-Module],
      FileNotFoundException
    • FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCom
      mand

Import-Module : The specified module '\Invoke-NuGetPackageRestore.psm1' was not loaded because no valid module file was found in any module directory.
At D:\dev\projects\aspnet_core_akka_net\microcafe\Build-MicroServices.ps1:5 char:14

  • Import-Module <<<< -Name "$PSScriptRoot\Invoke-NuGetPackageRestore.psm1"
    • CategoryInfo : ResourceUnavailable: (\Invoke-NuGetPackageRestore.psm1:String) [Impo
      rt-Module], FileNotFoundException
    • FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCom
      mand

Method invocation failed because [System.Object[]] doesn't contain a method named 'IndexOf'.
At D:\dev\projects\aspnet_core_akka_net\microcafe\Build-MicroServices.ps1:54 char:82

  • $success = BuildSolution $solution.Path $solution.Solution $solutions.IndexOf <<<< ($solution
    

) $solutions.Length
+ CategoryInfo : InvalidOperation: (IndexOf:String) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound
`

@rbanks54
Copy link
Owner

rbanks54 commented Sep 8, 2017

For whatever reason it looks like the Invoke-MsBuild and Invoke-NuGetPackageRestore powershell files aren't in the same folder as the Build-Microservices script.

Or, it could be that you're using an old version of Powershell that doesn't support the $PSScriptRoot variable. You need to be using PowerShell v3 or higher.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants