diff --git a/fscps.tools/fscps.tools.psd1 b/fscps.tools/fscps.tools.psd1 index 7bce6f8..30d7b2e 100644 --- a/fscps.tools/fscps.tools.psd1 +++ b/fscps.tools/fscps.tools.psd1 @@ -51,7 +51,7 @@ PowerShellVersion = '5.0' # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @(@{ModuleName = 'PSFramework'; ModuleVersion = '1.12.346'; }, +RequiredModules = @(@{ModuleName = 'PSFramework'; ModuleVersion = '1.13.406'; }, @{ModuleName = 'Az.Storage'; ModuleVersion = '1.11.0'; }, @{ModuleName = 'd365fo.tools'; ModuleVersion = '0.7.22'; }, @{ModuleName = 'Invoke-MsBuild'; ModuleVersion = '2.7.1'; }, diff --git a/fscps.tools/fscps.tools.psm1 b/fscps.tools/fscps.tools.psm1 index 18f9e9a..5a1174d 100644 --- a/fscps.tools/fscps.tools.psm1 +++ b/fscps.tools/fscps.tools.psm1 @@ -24,19 +24,19 @@ function Import-ModuleFile <# .SYNOPSIS Loads files into the module on module import. - + .DESCRIPTION This helper function is used during module initialization. It should always be dotsourced itself, in order to proper function. - + This provides a central location to react to files being imported, if later desired - + .PARAMETER Path The path to the file to load - + .EXAMPLE PS C:\> . Import-ModuleFile -File $function.FullName - + Imports the file stored in $function according to import policy #> [CmdletBinding()] @@ -44,25 +44,10 @@ function Import-ModuleFile [string] $Path ) + + if ($doDotSource) { . (Resolve-Path $Path) } - try { - $resolvedPath = $ExecutionContext.SessionState.Path.GetResolvedPSPathFromPSPath($Path).ProviderPath - if ($script:doDotSource) { - . $resolvedPath - } - else { - $content = [io.file]::ReadAllText($resolvedPath) - if (-not [string]::IsNullOrWhiteSpace($content)) { - $scriptBlock = [scriptblock]::Create($content) - if ($scriptBlock) { - $ExecutionContext.InvokeCommand.InvokeScript($false, $scriptBlock, $null, $null) - } - } - } - } - catch { - Write-Warning "Failed to import module file '$Path': $($_.Exception.Message)" - } + else { $ExecutionContext.InvokeCommand.InvokeScript($false, ([scriptblock]::Create([io.file]::ReadAllText((Resolve-Path $Path)))), $null, $null) } } diff --git a/fscps.tools/functions/get-fscpsmodelversion.ps1 b/fscps.tools/functions/get-fscpsmodelversion.ps1 index 55cbc7d..3a2b9a2 100644 --- a/fscps.tools/functions/get-fscpsmodelversion.ps1 +++ b/fscps.tools/functions/get-fscpsmodelversion.ps1 @@ -135,7 +135,4 @@ function Get-FSCPSModelVersion { end{ Invoke-TimeSignal -End } -} - -$curModelVersion = Get-FSCPSModelVersion -ModelPath "D:\Sources\vertex\connector-d365-unified-connector\PackagesLocalDirectory\Vertex" -$curModelVersion.Version \ No newline at end of file +} \ No newline at end of file