Skip to content

Commit ee16451

Browse files
Merge pull request #22 from PowershellFrameworkCollective/development
2.2.1.12
2 parents 9aefb0c + cfbd102 commit ee16451

File tree

100 files changed

+4840
-7
lines changed

Some content is hidden

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

100 files changed

+4840
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
# Ignore staging info from Visual Studio
99
library/PSModuleDevelopment/.vs/PSModuleDevelopment/v15/.suo
10+
library/PSModuleDevelopment/.vs/*
1011
library/PSModuleDevelopment/PSModuleDevelopment/bin/*
1112
library/PSModuleDevelopment/PSModuleDevelopment/obj/*
1213

PSModuleDevelopment/PSModuleDevelopment.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
RootModule = 'PSModuleDevelopment.psm1'
55

66
# Version number of this module.
7-
ModuleVersion = '2.2.0.11'
7+
ModuleVersion = '2.2.1.12'
88

99
# ID used to uniquely identify this module
1010
GUID = '37dd5fce-e7b5-4d57-ac37-832055ce49d6'

PSModuleDevelopment/PSModuleDevelopment.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
$script:PSModuleRoot = $PSScriptRoot
2-
$script:PSModuleVersion = "2.2.0.11"
2+
$script:PSModuleVersion = "2.2.1.12"
33

44
$script:doDotSource = $false
5-
if (Get-PSFConfigValue -Name PSModuleDevelopment.Import.DoDotSource) { $script:doDotSource = $true }
5+
if (Get-PSFConfigValue -FullName PSModuleDevelopment.Import.DoDotSource) { $script:doDotSource = $true }
66

77
#region Helper function
88
function Import-PSMDFile

PSModuleDevelopment/PSModuleDevelopment.psproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
<Folder>internal\tabcompletion</Folder>
2828
<Folder>internal\tabcompletion\scriptblocks</Folder>
2929
<Folder>internal\maintenance</Folder>
30-
<Folder>internal\tabcompletion\assignment</Folder>
3130
<Folder>internal\functions\template</Folder>
3231
<Folder>internal\templates</Folder>
3332
</Folders>
@@ -94,6 +93,12 @@
9493
<File Build="2">changelog.md</File>
9594
<File Build="2" Shared="True" ReferenceFunction="Invoke-template-store_ps1">internal\tabcompletion\scriptblocks\template-store.ps1</File>
9695
<File Build="2" Shared="True" ReferenceFunction="Invoke-template-templatename_ps1">internal\tabcompletion\scriptblocks\template-templatename.ps1</File>
96+
<File Build="2">internal\templates\function-1.0.0.0-Info.xml</File>
97+
<File Build="2">internal\templates\function-1.0.0.0.xml</File>
98+
<File Build="2">internal\templates\module-1.0.0.0-Info.xml</File>
99+
<File Build="2">internal\templates\module-1.0.0.0.xml</File>
100+
<File Build="2">internal\templates\PSMDTemplateReference-1.0.0.0-Info.xml</File>
101+
<File Build="2">internal\templates\PSMDTemplateReference-1.0.0.0.xml</File>
97102
</Files>
98103
<StartupScript>F:\Synchronized Data\Scripte\Powershell Studio\Projects\PSModuleDevelopment\Test-Module.ps1</StartupScript>
99104
</Project>

PSModuleDevelopment/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Changelog
2+
## 2.2.1.12 (March 08th, 2018)
3+
- Added out-of-the box templates
4+
- fix: Verious bugfixes around the template system
5+
26
## 2.2.1.11 (March 06th, 2018)
37
- new: Alias imt --> Invoke-PSMDTemplate
48
- Upd: Added TabCompletion to *-PSMDTemplate commands

PSModuleDevelopment/functions/templating/Get-PSMDTemplate.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
#endregion Apply filters
172172

173173
#region Return valid templates
174-
if ($All) { return $filteredProspects }
174+
if ($All) { return $filteredProspects | Sort-Object Type, Name, Version }
175175

176176
$prospectHash = @{ }
177177
foreach ($prospect in $filteredProspects)
@@ -185,7 +185,7 @@
185185
$prospectHash[$prospect.Name] = $prospect
186186
}
187187
}
188-
$prospectHash.Values
188+
$prospectHash.Values | Sort-Object Type, Name
189189
#endregion Return valid templates
190190
}
191191
}

PSModuleDevelopment/functions/templating/New-PSMDTemplate.ps1

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,18 @@
229229
}
230230
#endregion Insert basic meta-data
231231

232+
#region Validation
233+
#region Validate FilePath
234+
if ($FilePath)
235+
{
236+
if (-not (Test-Path $FilePath -PathType Leaf))
237+
{
238+
Stop-PSFFunction -Message "Filepath $FilePath is invalid. Ensure it exists and is a file" -EnableException $EnableException -Category InvalidArgument -Tag 'fail', 'argument', 'path'
239+
return
240+
}
241+
}
242+
#endregion Validate FilePath
243+
232244
#region Validate & ensure output folder
233245
$fileName = "$($template.Name)-$($template.Version).xml"
234246
$infoFileName = "$($template.Name)-$($template.Version)-Info.xml"
@@ -265,6 +277,7 @@
265277
return
266278
}
267279
#endregion Validate & ensure output folder
280+
#endregion Validation
268281

269282
#region Utility functions
270283
function Convert-Item
@@ -428,7 +441,7 @@
428441
#region Fixed string replacement
429442
if ($find.Groups[1].Success)
430443
{
431-
if ($object.FileSystemParameterFlat -notcontains $find.Groups[1].Value)
444+
if ($object.ContentParameterFlat -notcontains $find.Groups[1].Value)
432445
{
433446
$null = $object.ContentParameterFlat.Add($find.Groups[1].Value)
434447
}
@@ -522,6 +535,7 @@
522535
foreach ($item in (Get-ChildItem -Path $processedReferencePath -Filter $Filter))
523536
{
524537
if ($item.FullName -in $Exclusions) { continue }
538+
if ($item.Name -eq "PSMDTemplate.ps1") { continue }
525539
Convert-Item -Item $item -Filter $Filter -Exclusions $Exclusions -Template $template -ReferencePath $processedReferencePath -Identifier $identifier -BinaryExtensions $binaryExtensions
526540
}
527541
}
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)