File tree Expand file tree Collapse file tree 12 files changed +52
-12
lines changed Expand file tree Collapse file tree 12 files changed +52
-12
lines changed Original file line number Diff line number Diff line change 4
4
- New: Search-PSMDPropertyValue - search objects for values in properties
5
5
- Upd: Template PSFTest - adding WMI commands to list of forbidden commands
6
6
- Upd: Template PSFModule - adding changelog
7
+ - Upd: Template PSFModule - adding strings for localization
8
+ - Upd: Template PSFModule - adding scriptblocks
9
+ - Upd: Template PSFProject - updated build txt files to include new module content
10
+ - Fix: Template PSMTest - replacing all -Filter calls on Get-ChildItem
7
11
- Fix: New-PSMDTemplate records binary files as text files
8
12
9
13
## 2.2.5.41 (December 18th, 2018)
Original file line number Diff line number Diff line change
1
+ # This is where the strings go, that are written by
2
+ # Write-PSFMessage, Stop-PSFFunction or the PSFramework validation scriptblocks
3
+ @ {
4
+ ' key' = ' Value'
5
+ }
Original file line number Diff line number Diff line change
1
+ <#
2
+ Stored scriptblocks are available in [PsfValidateScript()] attributes.
3
+ This makes it easier to centrally provide the same scriptblock multiple times,
4
+ without having to maintain it in separate locations.
5
+
6
+ It also prevents lengthy validation scriptblocks from making your parameter block
7
+ hard to read.
8
+
9
+ Set-PSFScriptblock -Name 'þnameþ.ScriptBlockName' -Scriptblock {
10
+
11
+ }
12
+ #>
Original file line number Diff line number Diff line change 1
1
# Add all things you want to run after importing the main code
2
2
3
3
# Load Configurations
4
- foreach ($file in (Get-ChildItem " $ModuleRoot \internal\configurations\*.ps1" - ErrorAction Ignore)) {
4
+ foreach ($file in (Get-ChildItem " $ ( $script :ModuleRoot ) \internal\configurations\*.ps1" - ErrorAction Ignore)) {
5
+ . Import-ModuleFile - Path $file.FullName
6
+ }
7
+
8
+ # Load Scriptblocks
9
+ foreach ($file in (Get-ChildItem " $ ( $script :ModuleRoot ) \internal\scriptblocks\*.ps1" - ErrorAction Ignore)) {
5
10
. Import-ModuleFile - Path $file.FullName
6
11
}
7
12
8
13
# Load Tab Expansion
9
- foreach ($file in (Get-ChildItem " $ModuleRoot \internal\tepp\*.tepp.ps1" - ErrorAction Ignore)) {
14
+ foreach ($file in (Get-ChildItem " $ ( $ script : ModuleRoot) \internal\tepp\*.tepp.ps1" - ErrorAction Ignore)) {
10
15
. Import-ModuleFile - Path $file.FullName
11
16
}
12
17
13
18
# Load Tab Expansion Assignment
14
- . Import-ModuleFile - Path " $ModuleRoot \internal\tepp\assignment.ps1"
19
+ . Import-ModuleFile - Path " $ ( $ script : ModuleRoot) \internal\tepp\assignment.ps1"
15
20
16
21
# Load License
17
- . Import-ModuleFile - Path " $ModuleRoot \internal\scripts\license.ps1"
22
+ . Import-ModuleFile - Path " $ ( $ script : ModuleRoot) \internal\scripts\license.ps1"
Original file line number Diff line number Diff line change 1
- # Add all things you want to run before importing the main code
1
+ # Add all things you want to run before importing the main code
2
+
3
+ # Load the strings used in messages
4
+ . Import-ModuleFile - Path " $ ( $script :ModuleRoot ) \internal\scripts\strings.ps1"
Original file line number Diff line number Diff line change
1
+ <#
2
+ This file loads the strings documents from the respective language folders.
3
+ This allows localizing messages and errors.
4
+ Load psd1 language files for each language you wish to support.
5
+ Partial translations are acceptable - when missing a current language message,
6
+ it will fallback to English or another available language.
7
+ #>
8
+ Import-PSFLocalizedString - Path " $ ( $script :ModuleRoot ) \en-us\*.psd1" - Module ' þnameþ' - Language ' en-US'
Original file line number Diff line number Diff line change 2
2
# In the order they are loaded during postimport
3
3
4
4
internal\configurations\*.ps1
5
+ internal\scriptblocks\*.ps1
5
6
internal\tepp\*.tepp.ps1
6
7
internal\tepp\assignment.ps1
7
8
internal\scripts\license.ps1
Original file line number Diff line number Diff line change 1
1
# List all files that are loaded in the preimport.ps1
2
- # In the order they are loaded during preimport
2
+ # In the order they are loaded during preimport
3
+
4
+ internal\scripts\strings.ps1
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ function Get-FileEncoding
33
33
34
34
Describe " Verifying integrity of module files" {
35
35
Context " Validating PS1 Script files" {
36
- $allFiles = Get-ChildItem - Path $moduleRoot - Recurse - Filter " *.ps1" | Where-Object FullName -NotLike " $moduleRoot \tests\*"
36
+ $allFiles = Get-ChildItem - Path $moduleRoot - Recurse | Where-Object Name -like " *.ps1" | Where-Object FullName -NotLike " $moduleRoot \tests\*"
37
37
38
38
foreach ($file in $allFiles )
39
39
{
@@ -72,7 +72,7 @@ Describe "Verifying integrity of module files" {
72
72
}
73
73
74
74
Context " Validating help.txt help files" {
75
- $allFiles = Get-ChildItem - Path $moduleRoot - Recurse - Filter " *.help.txt" | Where-Object FullName -NotLike " $moduleRoot \tests\*"
75
+ $allFiles = Get-ChildItem - Path $moduleRoot - Recurse | Where-Object Name -like " *.help.txt" | Where-Object FullName -NotLike " $moduleRoot \tests\*"
76
76
77
77
foreach ($file in $allFiles )
78
78
{
Original file line number Diff line number Diff line change 2
2
$moduleRoot = (Resolve-Path " $PSScriptRoot \..\.." ).Path
3
3
$manifest = ((Get-Content " $moduleRoot \þnameþ.psd1" ) -join " `n " ) | Invoke-Expression
4
4
Context " Basic resources validation" {
5
- $files = Get-ChildItem " $moduleRoot \functions" - Recurse - File - Filter " *.ps1"
5
+ $files = Get-ChildItem " $moduleRoot \functions" - Recurse - File | Where-Object Name -like " *.ps1"
6
6
It " Exports all functions in the public folder" {
7
7
8
8
$functions = (Compare-Object - ReferenceObject $files.BaseName - DifferenceObject $manifest.FunctionsToExport | Where-Object SideIndicator -Like ' <=' ).InputObject
You can’t perform that action at this time.
0 commit comments