rbanks54 / microcafe

Sample code to show microservices using NET, in the context of a cafe
119 stars 50 forks source link

Problem running powershell scripts, such as #16

Open alturium opened 7 years ago

alturium commented 7 years ago

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 : 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

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

rbanks54 commented 7 years ago

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.