Skip to content
Merged

Fix #175

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fscps.tools/fscps.tools.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -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'; },
Expand Down
31 changes: 8 additions & 23 deletions fscps.tools/fscps.tools.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -24,45 +24,30 @@ 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()]
Param (
[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) }
}


Expand Down
5 changes: 1 addition & 4 deletions fscps.tools/functions/get-fscpsmodelversion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}