Skip to content

Commit c12e7ab

Browse files
Merge branch 'development' into HelpUri
2 parents d705892 + 55cb65f commit c12e7ab

63 files changed

Lines changed: 1813 additions & 261 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
# ignore PowerShell Studio files
2-
*TempPoint*
3-
*.pssproj
41

5-
# ignore the settings folder and files for VSCode
2+
# ignore the settings folder and files for VSCode and PSS
63
.vscode/*
74
*.psproj
8-
*.psproj.psbuild
9-
*.psprojs
5+
*TempPoint*
106

11-
# ignore library
12-
library/PSFramework/obj/*
13-
library/PSFramework/*.user
7+
# Ignore staging info from Visual Studio
8+
library/.vs/*
149
library/PSFramework/bin/*
15-
library/.vs/PSFramework/v15/.suo
16-
library/.vs/PSFramework/v15/server/*
10+
library/PSFramework/obj/*
11+
12+
# ignore PowerShell Studio MetaData
13+
PSFramework/PSFramework.psproj
14+
PSFramework/PSFramework.psproj.bak
15+
PSFramework/PSFramework.psprojs
16+
PSFramework/PSFramework.psproj
17+
18+
# ignore the TestResults
19+
TestResults/*
20+
21+
# ignore the publishing Directory
22+
publish/*

LICENSE.md renamed to LICENSE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
MIT License
2+
13
Copyright (c) 2017 Friedrich Weinmann
24

35
Permission is hereby granted, free of charge, to any person obtaining a copy

PSFramework/PSFramework.psd1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
RootModule = 'PSFramework.psm1'
66

77
# Version number of this module.
8-
ModuleVersion = '0.9.25.107'
8+
ModuleVersion = '0.10.27.135'
99

1010
# ID used to uniquely identify this module
1111
GUID = '8028b914-132b-431f-baa9-94a6952f21ff'
@@ -52,7 +52,7 @@
5252
ScriptsToProcess = @()
5353

5454
# Type files (.ps1xml) to be loaded when importing this module
55-
TypesToProcess = @()
55+
# TypesToProcess = @('xml\PSFramework.Types.ps1xml')
5656

5757
# Format files (.ps1xml) to be loaded when importing this module
5858
FormatsToProcess = @('xml\PSFramework.Format.ps1xml')
@@ -64,6 +64,8 @@
6464
# Functions to export from this module
6565
FunctionsToExport = @(
6666
'Clear-PSFResultCache',
67+
'ConvertFrom-PSFClixml',
68+
'ConvertTo-PSFClixml',
6769
'Disable-PSFTaskEngineTask',
6870
'Enable-PSFTaskEngineTask',
6971
'Export-PSFClixml',
@@ -80,6 +82,7 @@
8082
'Get-PSFTaskEngineCache',
8183
'Get-PSFTaskEngineTask',
8284
'Get-PSFTypeSerializationData',
85+
'Get-PSFUserChoice',
8386
'Import-PSFClixml',
8487
'Import-PSFCmdlet',
8588
'Import-PSFConfig',
@@ -119,6 +122,7 @@
119122
'Test-PSFTaskEngineCache',
120123
'Test-PSFTaskEngineTask',
121124
'Unregister-PSFConfig',
125+
'Wait-PSFMessage',
122126
'Write-PSFHostColor',
123127
'Write-PSFMessageProxy'
124128
)

PSFramework/PSFramework.psm1

Lines changed: 75 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
1-
$script:PSModuleRoot = $PSScriptRoot
2-
$script:PSModuleVersion = "0.9.25.107"
3-
4-
function Import-ModuleFile
5-
{
6-
[CmdletBinding()]
7-
Param (
8-
[string]
9-
$Path
10-
)
11-
12-
if ($doDotSource) { . $Path }
13-
else { $ExecutionContext.InvokeCommand.InvokeScript($false, ([scriptblock]::Create([io.file]::ReadAllText($Path))), $null, $null) }
14-
}
15-
16-
# Declare directory separating character for X-Plat compatibility
17-
$script:dc = [System.IO.Path]::DirectorySeparatorChar
1+
$script:ModuleRoot = $PSScriptRoot
2+
$script:ModuleVersion = "0.10.27.135"
183

194
# Detect whether at some level dotsourcing was enforced
205
$script:doDotSource = $false
@@ -25,26 +10,84 @@ if (($PSVersionTable.PSVersion.Major -lt 6) -or ($PSVersionTable.OS -like "*Wind
2510
if ((Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\WindowsPowerShell\PSFramework\System" -Name "DoDotSource" -ErrorAction Ignore).DoDotSource) { $script:doDotSource = $true }
2611
}
2712

28-
# Execute Preimport actions
29-
. Import-ModuleFile -Path "$($PSModuleRoot)$($dc)internal$($dc)scripts$($dc)preimport.ps1"
13+
<#
14+
Note on Resolve-Path:
15+
All paths are sent through Resolve-Path in order to convert them to the correct path separator.
16+
This allows ignoring path separators throughout the import sequence, which could otherwise cause trouble depending on OS.
17+
#>
3018

31-
# Import all internal functions
32-
foreach ($function in (Get-ChildItem "$($PSModuleRoot)$($dc)internal$($dc)functions$($dc)*$($dc)*.ps1"))
19+
# Detect whether at some level loading individual module files, rather than the compiled module was enforced
20+
$importIndividualFiles = $false
21+
if ($PSFramework_importIndividualFiles) { $importIndividualFiles = $true }
22+
if (($PSVersionTable.PSVersion.Major -lt 6) -or ($PSVersionTable.OS -like "*Windows*"))
3323
{
34-
. Import-ModuleFile -Path $function.FullName
24+
if ((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsPowerShell\PSFramework\System" -Name "ImportIndividualFiles" -ErrorAction Ignore).ImportIndividualFiles) { $script:doDotSource = $true }
25+
if ((Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\WindowsPowerShell\PSFramework\System" -Name "ImportIndividualFiles" -ErrorAction Ignore).ImportIndividualFiles) { $script:doDotSource = $true }
3526
}
36-
37-
# Import all public functions
38-
foreach ($function in (Get-ChildItem "$($PSModuleRoot)$($dc)functions$($dc)*$($dc)*.ps1"))
27+
if (Test-Path (Join-Path (Resolve-Path -Path "$($script:ModuleRoot)\..") '.git')) { $importIndividualFiles = $true }
28+
if (-not (Test-Path (Join-Path $script:ModuleRoot "commands.ps1"))) { $importIndividualFiles = $true }
29+
30+
function Import-ModuleFile
3931
{
40-
. Import-ModuleFile -Path $function.FullName
32+
<#
33+
.SYNOPSIS
34+
Loads files into the module on module import.
35+
36+
.DESCRIPTION
37+
This helper function is used during module initialization.
38+
It should always be dotsourced itself, in order to proper function.
39+
40+
This provides a central location to react to files being imported, if later desired
41+
42+
.PARAMETER Path
43+
The path to the file to load
44+
45+
.EXAMPLE
46+
PS C:\> . Import-ModuleFile -File $function.FullName
47+
48+
Imports the file stored in $function according to import policy
49+
#>
50+
[CmdletBinding()]
51+
Param (
52+
[string]
53+
$Path
54+
)
55+
56+
if ($doDotSource) { . (Resolve-Path $Path) }
57+
else { $ExecutionContext.InvokeCommand.InvokeScript($false, ([scriptblock]::Create([io.file]::ReadAllText((Resolve-Path $Path)))), $null, $null) }
4158
}
4259

43-
44-
# Execute Postimport actions
45-
. Import-ModuleFile -Path "$($PSModuleRoot)$($dc)internal$($dc)scripts$($dc)postimport.ps1"
46-
47-
if ($PSCommandPath -like "*psframework.psm1*")
60+
if ($importIndividualFiles)
4861
{
49-
Import-Module "$($PSModuleRoot)$($dc)bin$($dc)PSFramework.dll"
62+
# Execute Preimport actions
63+
. Import-ModuleFile -Path "$($script:ModuleRoot)\internal\scripts\preimport.ps1"
64+
65+
# Import all internal functions
66+
foreach ($function in (Get-ChildItem "$($script:ModuleRoot)\internal\functions" -Filter "*.ps1" -Recurse -ErrorAction Ignore))
67+
{
68+
. Import-ModuleFile -Path $function.FullName
69+
}
70+
71+
# Import all public functions
72+
foreach ($function in (Get-ChildItem "$($script:ModuleRoot)\functions" -Filter "*.ps1" -Recurse -ErrorAction Ignore))
73+
{
74+
. Import-ModuleFile -Path $function.FullName
75+
}
76+
77+
# Execute Postimport actions
78+
. Import-ModuleFile -Path "$($script:ModuleRoot)\internal\scripts\postimport.ps1"
79+
}
80+
else
81+
{
82+
if (Test-Path (Join-Path $script:ModuleRoot "resourcesBefore.ps1"))
83+
{
84+
. Import-ModuleFile -Path "$($script:ModuleRoot)\resourcesBefore.ps1"
85+
}
86+
87+
. Import-ModuleFile -Path "$($script:ModuleRoot)\commands.ps1"
88+
89+
if (Test-Path (Join-Path $script:ModuleRoot "resourcesAfter.ps1"))
90+
{
91+
. Import-ModuleFile -Path "$($script:ModuleRoot)\resourcesAfter.ps1"
92+
}
5093
}

PSFramework/bin/PSFramework.dll

5 KB
Binary file not shown.

PSFramework/bin/PSFramework.pdb

20 KB
Binary file not shown.

0 commit comments

Comments
 (0)