Skip to content

Commit d80904b

Browse files
authored
Set the module to be system agnostic
Linked to this issue : PowershellFrameworkCollective/psframework#191 Here is the documentation saying / and \ are agnotic with cmdlets : https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-core-60?view=powershell-6#filesystem Hence why I did not chance all the calls to "Path" But it seems to not be the case for .NET Methods (or at least some of them)
1 parent f550041 commit d80904b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PSModuleDevelopment/PSModuleDevelopment.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function Import-PSMDFile
3030
)
3131

3232
if ($script:doDotSource) { . $Path }
33-
else { $ExecutionContext.InvokeCommand.InvokeScript($false, ([scriptblock]::Create([io.file]::ReadAllText($Path))), $null, $null) }
33+
else { $ExecutionContext.InvokeCommand.InvokeScript($false, ([scriptblock]::Create([io.file]::ReadAllText($(Resolve-Path $Path)))), $null, $null) }
3434
}
3535
#endregion Helper function
3636

@@ -53,4 +53,4 @@ foreach ($function in (Get-ChildItem "$PSModuleRoot\functions" -Recurse -File -F
5353
#endregion Load functions
5454

5555
# Perform Actions after loading the module contents
56-
. Import-PSMDFile -Path "$PSModuleRoot\internal\scripts\postload.ps1"
56+
. Import-PSMDFile -Path "$PSModuleRoot\internal\scripts\postload.ps1"

0 commit comments

Comments
 (0)