How do you use using module
with $PSScriptRoot
?
using module $PSScriptRoot/../myfolder/base.psm1
# or: using module "$PSScriptRoot/../myfolder/base.psm1"
If I do this, I get this error:
using module $PSScriptRoot: is not a valid value for using name
Thanks to @DavidBrabant I have tried the following:
$scriptBody = "using module /Users/name/Development/tools/powershell/base/base.psm1"
$script = [ScriptBlock]::Create($scriptBody)
. $script
Class Go : MyBaseClass {
...
Unfortunately I get:
Unable to find type [MyBaseClass].PowerShell
Ignoring 'TypeNotFound' parse error on type 'MyBaseClass'. Check if the specified type is correct. This can also be due the type not being known at parse time due to types
Thanks to and @MathiasR.Jessen I tried with "\" with same result. I should say that I am on a mac computer if that makes any different.