Skip to content

Commit b9c5f21

Browse files
Merge pull request #17 from PowershellFrameworkCollective/templates-upgrades
Templates upgrades
2 parents ac78841 + 4def7c2 commit b9c5f21

File tree

10 files changed

+111
-78
lines changed

10 files changed

+111
-78
lines changed

PSModuleDevelopment/PSModuleDevelopment.psd1

Lines changed: 3 additions & 2 deletions
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.10'
7+
ModuleVersion = '2.2.0.11'
88

99
# ID used to uniquely identify this module
1010
GUID = '37dd5fce-e7b5-4d57-ac37-832055ce49d6'
@@ -101,6 +101,7 @@
101101
'dotnetnew',
102102
'find',
103103
'hex',
104+
'imt',
104105
'Restart-Shell',
105106
'rss',
106107
'ipmod',
@@ -126,7 +127,7 @@
126127
# LicenseUri = ''
127128

128129
# A URL to the main website for this project.
129-
ProjectUri = 'https://github.com/PowershellFrameworkCollective/PSModuleDevelopment'
130+
ProjectUri = 'http://psframework.org'
130131

131132
# A URL to an icon representing this module.
132133
# IconUri = ''

PSModuleDevelopment/PSModuleDevelopment.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$script:PSModuleRoot = $PSScriptRoot
2-
$script:PSModuleVersion = "2.2.0.10"
2+
$script:PSModuleVersion = "2.2.0.11"
33

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

PSModuleDevelopment/PSModuleDevelopment.psproj

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<Folder>internal\maintenance</Folder>
3030
<Folder>internal\tabcompletion\assignment</Folder>
3131
<Folder>internal\functions\template</Folder>
32+
<Folder>internal\templates</Folder>
3233
</Folders>
3334
<Files>
3435
<File Build="2">PSModuleDevelopment.psd1</File>
@@ -45,10 +46,6 @@
4546
<File Build="2" Shared="True" ReferenceFunction="Invoke-New-PssModuleProject_ps1">functions\utility\New-PssModuleProject.ps1</File>
4647
<File Build="2">en-us\about_psmoduledevelopment.help.txt</File>
4748
<File Build="2" Shared="True" ReferenceFunction="Invoke-Set-PSMDModulePath_ps1">functions\utility\Set-PSMDModulePath.ps1</File>
48-
<File Build="2" Shared="True" ReferenceFunction="Invoke-Get-PSMDWixConfig_ps1">internal\functions\wix\Get-PSMDWixConfig.ps1</File>
49-
<File Build="2" Shared="True" ReferenceFunction="Invoke-Set-PSMDWixConfig_ps1">internal\functions\wix\Set-PSMDWixConfig.ps1</File>
50-
<File Build="2" Shared="True" ReferenceFunction="Invoke-Invoke-PSMDWixBuild_ps1">internal\functions\wix\Invoke-PSMDWixBuild.ps1</File>
51-
<File Build="2" Shared="False" ReferenceFunction="Invoke-Invoke-PSMDWixBuild2_ps1">internal\functions\wix\Invoke-PSMDWixBuild2.ps1</File>
5249
<File Build="2" Shared="False" ReferenceFunction="Invoke-wix_ps1">internal\configurations\wix.ps1</File>
5350
<File Build="2" Shared="False" ReferenceFunction="Invoke-debug_ps1">internal\configurations\debug.ps1</File>
5451
<File Build="2" Shared="False" ReferenceFunction="Invoke-license_ps1">internal\scripts\license.ps1</File>
@@ -89,6 +86,14 @@
8986
<File Build="2" Shared="True" ReferenceFunction="Invoke-template_ps1">internal\configurations\template.ps1</File>
9087
<File Build="2" Shared="True" ReferenceFunction="Invoke-Invoke-PSMDTemplate_ps1">functions\templating\Invoke-PSMDTemplate.ps1</File>
9188
<File Build="2" Shared="True" ReferenceFunction="Invoke-Get-PsmdTemplateStore_ps1">internal\functions\template\Get-PsmdTemplateStore.ps1</File>
89+
<File Build="2">xml\PSModuleDevelopment.Types.ps1xml</File>
90+
<File Build="2">internal\functions\wix\Get-PSMDWixConfig.txt</File>
91+
<File Build="2">internal\functions\wix\Invoke-PSMDWixBuild.txt</File>
92+
<File Build="2">internal\functions\wix\Invoke-PSMDWixBuild2.txt</File>
93+
<File Build="2">internal\functions\wix\Set-PSMDWixConfig.txt</File>
94+
<File Build="2">changelog.md</File>
95+
<File Build="2" Shared="True" ReferenceFunction="Invoke-template-store_ps1">internal\tabcompletion\scriptblocks\template-store.ps1</File>
96+
<File Build="2" Shared="True" ReferenceFunction="Invoke-template-templatename_ps1">internal\tabcompletion\scriptblocks\template-templatename.ps1</File>
9297
</Files>
9398
<StartupScript>F:\Synchronized Data\Scripte\Powershell Studio\Projects\PSModuleDevelopment\Test-Module.ps1</StartupScript>
9499
</Project>

PSModuleDevelopment/changelog.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Changelog
2+
## 2.2.1.11 (March 06th, 2018)
3+
- new: Alias imt --> Invoke-PSMDTemplate
4+
- Upd: Added TabCompletion to *-PSMDTemplate commands
5+
6+
## 2.2.0.10 (March 06th, 2018)
7+
- new: Command New-PSMDTemplate
8+
- new: Command Get-PSMDTemplate
9+
- new: Command Invoke-PSMDTemplate
10+
- new: Command Remove-PSMDTemplate
11+
12+
## 2.1.1.3 (February 06th, 2018)
13+
- new: Command New-PSMDModuleNugetPackage - A command that takes a module and writes it to a Nuget package.
14+
- Upd: Increased PSFramework required version to 0.9.9.19
15+
16+
## 2.1.0.1 (January 24th, 2018)
17+
- new: Included suite of tests, in order to provide a more reliable user experience.
18+
- new: Command New-PSMDDotNetProject - A wrapper around dotnet.exe
19+
20+
## 2.0.0.0 (December 18th, 2017)
21+
- Breaking change: Renamed all commands to include the PSMD prefix
22+
- New function: Find-PSMDFileContent (alias: find), to swiftly search in your current project
23+
- New function: New-PSMDHeader, to create headers for documentation
24+
- New function: Set-PSMDModulePath, to define the project currently being worked on
25+
- Suite of new functions that refactor a project:
26+
27+
```
28+
Rename-PSMDParameter: Renames a parameter, then updates the function's internal use, then updates the parameter usage across the entire module.
29+
Set-PSMDCmdletBinding: Inserts a CmdletBinding-Attribute into all functions that need one
30+
Set-PSMDParameterHelp: Globally updates parameter help for all commands that share a parameter across the project
31+
Split-PSMDScriptFile: Exports all functions in a file and creates new files, one per function, named after the function
32+
```
33+
34+
- New function: New-PSMDFormatTableDefinition, creates format xml for input types that will present it by default as a table
35+
- New function: Expand-PSMDTypeName, returns a list of all type-names an object has (by default, the entire inheritance chain)
36+
- New function: Find-PSMDType, search currently imported assemblies for types
37+
- New function: Get-PSMDAssembly, return the currently imported assemblies
38+
- New function: Get-PSMDConstructor, return the constructor definitions for a type or the type of an input object
39+
40+
## 1.3.0.0 (October 19th, 2016):
41+
- New function: Measure-CommandEx
42+
- Renamed function: Get-ExHelp --> Get-HelpEx
43+
- New Alias: Get-ExHelp --> Get-HelpEx
44+
- New Alias: hex --> Get-HelpEx
45+
46+
## 1.2.0.0 (August 15th, 2016):
47+
- New function: Get-ExHelp

PSModuleDevelopment/en-us/about_psmoduledevelopment.help.txt

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ LONG DESCRIPTION
2424
- Multilingual Help
2525
- The Need for Speed
2626
- Optimizing the debugging cycle
27-
- Changelog
2827

2928

3029
#-------------------------------------------------------------------------#
@@ -160,72 +159,5 @@ LONG DESCRIPTION
160159

161160
https://allthingspowershell.blogspot.com/2016/08/module-development-optimizing-test-and.html
162161

163-
164-
#-------------------------------------------------------------------------#
165-
# Changelog #
166-
#-------------------------------------------------------------------------#
167-
168-
2.2.0.10 (March 06th, 2018)
169-
- new: Command New-PSMDTemplate
170-
- new: Command Get-PSMDTemplate
171-
- new: Command Invoke-PSMDTemplate
172-
- new: Command Remove-PSMDTemplate
173-
174-
2.1.1.3 (February 06th, 2018)
175-
- new: Command New-PSMDModuleNugetPackage
176-
A command that takes a module and writes it to a Nuget package.
177-
- Upd: Increased PSFramework required version to 0.9.9.19
178-
179-
2.1.0.1 (January 24th, 2018)
180-
- new: Included suite of tests, in order to provide a more reliable user
181-
experience.
182-
- new: Command New-PSMDDotNetProject
183-
A wrapper around dotnet.exe
184-
185-
2.0.0.0 (December 18th, 2017)
186-
- Breaking change: Renamed all commands to include the PSMD prefix
187-
- New function: Find-PSMDFileContent (alias: find), to swiftly search in
188-
your current project
189-
- New function: New-PSMDHeader, to create headers for documentation
190-
- New function: Set-PSMDModulePath, to define the project currently being
191-
worked on
192-
- Suite of new functions that refactor a project:
193-
Rename-PSMDParameter: Renames a parameter, then updates the function's
194-
internal use, then updates the parameter usage
195-
across the entire module.
196-
Set-PSMDCmdletBinding: Inserts a CmdletBinding-Attribute into all
197-
functions that need one
198-
Set-PSMDParameterHelp: Globally updates parameter help for all commands
199-
that share a parameter across the project
200-
Split-PSMDScriptFile: Exports all functions in a file and creates new
201-
files, one per function, named after the function
202-
- New function: New-PSMDFormatTableDefinition, creates format xml for
203-
input types that will present it by default as a table
204-
- New function: Expand-PSMDTypeName, returns a list of all type-names an
205-
object has (by default, the entire inheritance chain)
206-
- New function: Find-PSMDType, search currently imported assemblies for
207-
types
208-
- New function: Get-PSMDAssembly, return the currently imported assemblies
209-
- New function: Get-PSMDConstructor, return the constructor definitions
210-
for a type or the type of an input object
211-
1.3.0.0 (October 19th, 2016):
212-
- New function: Measure-CommandEx
213-
Measures the executiontime of a scriptblock any number of time and
214-
presents the average execution time.
215-
This provides better statistics, as a single run can easily be
216-
influenced by outside factors, while an average over a thousand
217-
executions will be more reliable.
218-
- Renamed function: Get-ExHelp --> Get-HelpEx
219-
Introduces constistent naming across functions and prevents confusing
220-
the "ex" (for Extended) with a module prefix.
221-
- New Alias: Get-ExHelp --> Get-HelpEx
222-
So that users who still like the old naming can still use it
223-
- New Alias: hex --> Get-HelpEx
224-
Because getting help should be simple.
225-
226-
1.2.0.0 (August 15th, 2016):
227-
- New function: Get-ExHelp
228-
Provides localized help to better test modules with localized help
229-
content.
230162
KEYWORDS
231163
module development debugging

PSModuleDevelopment/functions/templating/Invoke-PSMDTemplate.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,4 +433,6 @@
433433
{
434434

435435
}
436-
}
436+
}
437+
438+
if (-not (Test-Path Alias:\imt)) { Set-Alias -Name imt -Value Invoke-PSMDTemplate }
Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
# New-PSMDDotNetProject
1+
#region Templates
2+
# New-PSMDDotNetProject
23
Register-PSFTeppArgumentCompleter -Name PSMD_dotNetTemplates -Command New-PSMDDotNetProject -Parameter TemplateName
34
Register-PSFTeppArgumentCompleter -Name PSMD_dotNetTemplatesUninstall -Command New-PSMDDotNetProject -Parameter Uninstall
4-
Register-PSFTeppArgumentCompleter -Name PSMD_dotNetTemplatesInstall -Command New-PSMDDotNetProject -Parameter Install
5+
Register-PSFTeppArgumentCompleter -Name PSMD_dotNetTemplatesInstall -Command New-PSMDDotNetProject -Parameter Install
6+
7+
# New-PSMDTemplate
8+
Register-PSFTeppArgumentCompleter -Name PSMD_templatestore -Command New-PSMDTemplate -Parameter OutStore
9+
10+
# Get-PSMDTemplate
11+
Register-PSFTeppArgumentCompleter -Name PSMD_templatestore -Command Get-PSMDTemplate -Parameter Store
12+
Register-PSFTeppArgumentCompleter -Name PSMD_templatename -Command Get-PSMDTemplate -Parameter TemplateName
13+
14+
# Invoke-PSMDTemplate
15+
Register-PSFTeppArgumentCompleter -Name PSMD_templatestore -Command Invoke-PSMDTemplate -Parameter Store
16+
Register-PSFTeppArgumentCompleter -Name PSMD_templatename -Command Invoke-PSMDTemplate -Parameter TemplateName
17+
18+
# Remove-PSMDTemplate
19+
Register-PSFTeppArgumentCompleter -Name PSMD_templatestore -Command Remove-PSMDTemplate -Parameter Store
20+
Register-PSFTeppArgumentCompleter -Name PSMD_templatename -Command Remove-PSMDTemplate -Parameter TemplateName
21+
22+
#endregion Templates
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Register-PSFTeppScriptblock -Name PSMD_templatestore -ScriptBlock {
2+
Get-PSFConfig -FullName "PSModuleDevelopment.Template.Store.*" | ForEach-Object {
3+
$_.Name -replace "^.+\."
4+
}
5+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Register-PSFTeppScriptblock -Name PSMD_templatename -ScriptBlock {
2+
if ($fakeBoundParameter.Store)
3+
{
4+
$storeName = $fakeBoundParameter.Store
5+
}
6+
else
7+
{
8+
$storeName = "*"
9+
}
10+
11+
$storePaths = Get-PSFConfig -FullName "PSModuleDevelopment.Template.Store.$storeName" | Select-Object -ExpandProperty Value
12+
$names = @()
13+
foreach ($path in $storePaths)
14+
{
15+
Get-ChildItem $path | Where-Object { $_.Name -match '-Info.xml$' } | ForEach-Object {
16+
$names += $_.Name -replace '-\d+(\.\d+){0,3}-Info.xml$'
17+
}
18+
}
19+
20+
$names | Select-Object -Unique
21+
}

install.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,6 +2356,8 @@ function Write-LocalMessage
23562356

23572357
try
23582358
{
2359+
[System.Net.ServicePointManager]::SecurityProtocol = "Tls12"
2360+
23592361
Write-LocalMessage -Message "Downloading repository from '$($BaseUrl)/archive/$($Branch).zip'"
23602362
Invoke-WebRequest -Uri "$($BaseUrl)/archive/$($Branch).zip" -UseBasicParsing -OutFile "$($env:TEMP)\$($ModuleName).zip" -ErrorAction Stop
23612363

0 commit comments

Comments
 (0)