Skip to content

Commit 01eff11

Browse files
Merge pull request #7 from PowershellFrameworkCollective/development
2.1.0.1
2 parents e57cec3 + 4397fb6 commit 01eff11

Some content is hidden

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

42 files changed

+944
-76
lines changed

PSModuleDevelopment/PSModuleDevelopment.psd1

Lines changed: 4 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.0.0.0'
7+
ModuleVersion = '2.1.0.1'
88

99
# ID used to uniquely identify this module
1010
GUID = '37dd5fce-e7b5-4d57-ac37-832055ce49d6'
@@ -41,7 +41,7 @@
4141

4242
# Modules that must be imported into the global environment prior to importing
4343
# this module
44-
RequiredModules = @(@{ ModuleName='PSFramework'; ModuleVersion='0.9.4.9' })
44+
RequiredModules = @(@{ ModuleName='PSFramework'; ModuleVersion= '0.9.8.17' })
4545

4646
# Assemblies that must be loaded prior to importing this module
4747
RequiredAssemblies = @('bin\PSModuleDevelopment.dll')
@@ -71,6 +71,7 @@
7171
'Get-PSMDModuleDebug',
7272
'Import-PSMDModuleDebug',
7373
'Measure-PSMDCommandEx',
74+
'New-PSMDDotNetProject',
7475
'New-PSMDHeader',
7576
'New-PSMDFormatTableDefinition',
7677
'New-PssModuleProject',
@@ -92,6 +93,7 @@
9293

9394
# Aliases to export from this module
9495
AliasesToExport = @(
96+
'dotnetnew',
9597
'find',
9698
'hex',
9799
'Restart-Shell',

PSModuleDevelopment/PSModuleDevelopment.psm1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
$script:PSModuleDevelopmentModuleRoot = $PSScriptRoot
2-
$script:PSModuleDevelopmentModuleVersion = '2.0.0.0'
1+
$script:PSModuleRoot = $PSScriptRoot
2+
$script:PSModuleVersion = "2.1.0.1"
33

44
$script:doDotSource = $false
55
if (Get-PSFConfigValue -Name PSModuleDevelopment.Import.DoDotSource) { $script:doDotSource = $true }
@@ -36,14 +36,14 @@ function Import-PSMDFile
3636

3737

3838
# Perform Actions before loading the rest of the content
39-
. Import-PSMDFile -Path "$PSModuleDevelopmentModuleRoot\internal\scripts\preload.ps1"
39+
. Import-PSMDFile -Path "$PSModuleRoot\internal\scripts\preload.ps1"
4040

4141
#region Load functions
42-
foreach ($function in (Get-ChildItem "$PSModuleDevelopmentModuleRoot\functions" -Recurse -File -Filter "*.ps1"))
42+
foreach ($function in (Get-ChildItem "$PSModuleRoot\functions" -Recurse -File -Filter "*.ps1"))
4343
{
4444
. Import-PSMDFile -Path $function.FullName
4545
}
4646
#endregion Load functions
4747

4848
# Perform Actions after loading the module contents
49-
. Import-PSMDFile -Path "$PSModuleDevelopmentModuleRoot\internal\scripts\postload.ps1"
49+
. Import-PSMDFile -Path "$PSModuleRoot\internal\scripts\postload.ps1"

PSModuleDevelopment/PSModuleDevelopment.psproj

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Synchronized="True" SyncFilter="*.ps1;*.psm1;*.psd1;*.psxml;*.psf;*.pss;*.xml; *.txt;*.dll">
1+
<Project Synchronized="True" SyncFilter="*.ps1;*.psm1;*.psd1;*.psxml;*.psf;*.pss;*.xml; *.txt;*.dll;*.ps1xml;*.md">
22
<Version>2.0</Version>
33
<FileID>37dd5fce-e7b5-4d57-ac37-832055ce49d6</FileID>
44
<ProjectType>1</ProjectType>
@@ -11,14 +11,22 @@
1111
<Folder>functions\performance</Folder>
1212
<Folder>functions\help</Folder>
1313
<Folder>snippets</Folder>
14-
<Folder>functions\wix</Folder>
14+
<Folder>internal\functions\wix</Folder>
1515
<Folder>internal</Folder>
1616
<Folder>internal\configurations</Folder>
1717
<Folder>functions\format</Folder>
1818
<Folder>functions\refactor</Folder>
1919
<Folder>functions\assembly</Folder>
2020
<Folder>bin</Folder>
2121
<Folder>xml</Folder>
22+
<Folder>tests</Folder>
23+
<Folder>tests\functions</Folder>
24+
<Folder>tests\general</Folder>
25+
<Folder>internal\functions</Folder>
26+
<Folder>functions\templating</Folder>
27+
<Folder>internal\tabcompletion</Folder>
28+
<Folder>internal\tabcompletion\scriptblocks</Folder>
29+
<Folder>internal\maintenance</Folder>
2230
</Folders>
2331
<Files>
2432
<File Build="2">PSModuleDevelopment.psd1</File>
@@ -35,10 +43,10 @@
3543
<File Build="2" Shared="False" ReferenceFunction="Invoke-New-PssModuleProject_ps1">functions\utility\New-PssModuleProject.ps1</File>
3644
<File Build="2">en-us\about_psmoduledevelopment.help.txt</File>
3745
<File Build="2" Shared="False" ReferenceFunction="Invoke-Set-PSMDModulePath_ps1">functions\utility\Set-PSMDModulePath.ps1</File>
38-
<File Build="2" Shared="True" ReferenceFunction="Invoke-Get-PSMDWixConfig_ps1">functions\wix\Get-PSMDWixConfig.ps1</File>
39-
<File Build="2" Shared="True" ReferenceFunction="Invoke-Set-PSMDWixConfig_ps1">functions\wix\Set-PSMDWixConfig.ps1</File>
40-
<File Build="2" Shared="True" ReferenceFunction="Invoke-Invoke-PSMDWixBuild_ps1">functions\wix\Invoke-PSMDWixBuild.ps1</File>
41-
<File Build="2" Shared="False" ReferenceFunction="Invoke-Invoke-PSMDWixBuild2_ps1">functions\wix\Invoke-PSMDWixBuild2.ps1</File>
46+
<File Build="2" Shared="True" ReferenceFunction="Invoke-Get-PSMDWixConfig_ps1">internal\functions\wix\Get-PSMDWixConfig.ps1</File>
47+
<File Build="2" Shared="True" ReferenceFunction="Invoke-Set-PSMDWixConfig_ps1">internal\functions\wix\Set-PSMDWixConfig.ps1</File>
48+
<File Build="2" Shared="True" ReferenceFunction="Invoke-Invoke-PSMDWixBuild_ps1">internal\functions\wix\Invoke-PSMDWixBuild.ps1</File>
49+
<File Build="2" Shared="False" ReferenceFunction="Invoke-Invoke-PSMDWixBuild2_ps1">internal\functions\wix\Invoke-PSMDWixBuild2.ps1</File>
4250
<File Build="2" Shared="False" ReferenceFunction="Invoke-wix_ps1">internal\configurations\wix.ps1</File>
4351
<File Build="2" Shared="False" ReferenceFunction="Invoke-debug_ps1">internal\configurations\debug.ps1</File>
4452
<File Build="2" Shared="False" ReferenceFunction="Invoke-license_ps1">internal\scripts\license.ps1</File>
@@ -54,9 +62,24 @@
5462
<File Build="2" Shared="True" ReferenceFunction="Invoke-Find-PSMDFileContent_ps1">functions\utility\Find-PSMDFileContent.ps1</File>
5563
<File Build="2" Shared="True" ReferenceFunction="Invoke-utility_ps1">internal\configurations\utility.ps1</File>
5664
<File Build="2" Shared="True" ReferenceFunction="Invoke-Get-PSMDConstructor_ps1">functions\assembly\Get-PSMDConstructor.ps1</File>
57-
<File Build="2">xml\PSModuleDevelopment.Format.ps1xml</File>
5865
<File Build="2" Shared="True" ReferenceFunction="Invoke-Get-PSMDAssembly_ps1">functions\assembly\Get-PSMDAssembly.ps1</File>
5966
<File Build="2" Shared="True" ReferenceFunction="Invoke-Find-PSMDType_ps1">functions\assembly\Find-PSMDType.ps1</File>
67+
<File Build="2" Shared="True" ReferenceFunction="Invoke-pester_ps1">tests\pester.ps1</File>
68+
<File Build="2" Shared="True" ReferenceFunction="Invoke-FileIntegrity_Exceptions_ps1">tests\general\FileIntegrity.Exceptions.ps1</File>
69+
<File Build="2" Shared="True" ReferenceFunction="Invoke-FileIntegrity_Tests_ps1">tests\general\FileIntegrity.Tests.ps1</File>
70+
<File Build="2" Shared="True" ReferenceFunction="Invoke-Help_Exceptions_ps1">tests\general\Help.Exceptions.ps1</File>
71+
<File Build="2" Shared="True" ReferenceFunction="Invoke-Help_Tests_ps1">tests\general\Help.Tests.ps1</File>
72+
<File Build="2" Shared="True" ReferenceFunction="Invoke-manifest_Tests_ps1">tests\general\manifest.Tests.ps1</File>
73+
<File Build="2" Shared="True" ReferenceFunction="Invoke-PSScriptAnalyzer_Tests_ps1">tests\general\PSScriptAnalyzer.Tests.ps1</File>
74+
<File Build="2">tests\readme.md</File>
75+
<File Build="2">xml\PSModuleDevelopment.Format.ps1xml</File>
76+
<File Build="2">tests\functions\readme.md</File>
77+
<File Build="2" Shared="True" ReferenceFunction="Invoke-New-PSMDDotNetProject_ps1">functions\templating\New-PSMDDotNetProject.ps1</File>
78+
<File Build="2" Shared="True" ReferenceFunction="Invoke-assignment_ps1">internal\tabcompletion\assignment.ps1</File>
79+
<File Build="2" Shared="True" ReferenceFunction="Invoke-dotNetTemplates_ps1">internal\tabcompletion\scriptblocks\dotNetTemplates.ps1</File>
80+
<File Build="2" Shared="True" ReferenceFunction="Invoke-dotNetTemplatesUninstall_ps1">internal\tabcompletion\scriptblocks\dotNetTemplatesUninstall.ps1</File>
81+
<File Build="2" Shared="True" ReferenceFunction="Invoke-dotNetTemplateCache_ps1">internal\maintenance\dotNetTemplateCache.ps1</File>
82+
<File Build="2" Shared="True" ReferenceFunction="Invoke-dotNetTemplatesInstall_ps1">internal\tabcompletion\scriptblocks\dotNetTemplatesInstall.ps1</File>
6083
</Files>
6184
<StartupScript>F:\Synchronized Data\Scripte\Powershell Studio\Projects\PSModuleDevelopment\Test-Module.ps1</StartupScript>
6285
</Project>

PSModuleDevelopment/en-us/about_psmoduledevelopment.help.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ LONG DESCRIPTION
5454

5555
Register-PSFConfig -FullName 'PSModuleDevelopment.Module.Path'
5656

57-
# rss (Restart-PSMDShell #
58-
#------------------------#
57+
# rss (Restart-PSMDShell) #
58+
#-------------------------#
5959

6060
The best we to reset your test environment is to start a new console. This
6161
can be cumbersome though ... unless you use PSMD, in which case it is a
@@ -132,7 +132,7 @@ LONG DESCRIPTION
132132
# The Need for Speed #
133133
#-------------------------------------------------------------------------#
134134

135-
Speed matters.
135+
Speed matters.
136136
In order to develop high performance code however, you need to have the
137137
tools to measure speed accurately. PowerShell has out of the box a tool
138138
that helps with that: 'Measure-Command'
@@ -165,6 +165,12 @@ LONG DESCRIPTION
165165
# Changelog #
166166
#-------------------------------------------------------------------------#
167167

168+
2.1.0.1 (January 24th, 2018)
169+
- new: Included suite of tests, in order to provide a more reliable user
170+
experience.
171+
- new: Command New-PSMDDotNetProject
172+
A wrapper around dotnet.exe
173+
168174
2.0.0.0 (December 18th, 2017)
169175
- Breaking change: Renamed all commands to include the PSMD prefix
170176
- New function: Find-PSMDFileContent (alias: find), to swiftly search in
@@ -206,7 +212,7 @@ LONG DESCRIPTION
206212
- New Alias: hex --> Get-HelpEx
207213
Because getting help should be simple.
208214

209-
1.2.0.0 (August 15th, 2016):
215+
1.2.0.0 (August 15th, 2016):
210216
- New function: Get-ExHelp
211217
Provides localized help to better test modules with localized help
212218
content.

PSModuleDevelopment/functions/assembly/Expand-PSMDTypeName.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
{
2626
foreach ($item in $InputObject)
2727
{
28-
if ($item -eq $null) { continue }
28+
if ($null -eq $item) { continue }
2929

3030
$type = $item.GetType()
3131
if ($type.FullName -eq "System.RuntimeType") { $type = $item }

PSModuleDevelopment/functions/assembly/Get-PSMDConstructor.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
{
4242
foreach ($item in $InputObject)
4343
{
44-
if ($item -eq $null) { continue }
44+
if ($null -eq $item) { continue }
4545
if ($item -is [System.Type]) { $type = $item }
4646
else { $type = $item.GetType() }
4747

PSModuleDevelopment/functions/format/New-PSMDFormatTableDefinition.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
3838
Creates a format xml that only includes the columns LastWriteTime, FullName
3939
#>
40+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]
4041
[CmdletBinding()]
4142
Param (
4243
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]

PSModuleDevelopment/functions/moduledebug/Remove-PSMDModuleDebug.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
1010
.PARAMETER Name
1111
Name of modules whose debugging configuration should be removed.
12+
13+
.PARAMETER Confirm
14+
If this switch is enabled, you will be prompted for confirmation before executing any operations that change state.
15+
16+
.PARAMETER WhatIf
17+
If this switch is enabled, no actions are performed but informational messages will be displayed that explain what would happen if the command were to run.
1218
1319
.EXAMPLE
1420
PS C:\> Remove-PSMDModuleDebug -Name "cPSNetwork"

PSModuleDevelopment/functions/moduledebug/Set-PSMDModuleDebug.ps1

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,22 @@
2828
.PARAMETER PostImportAction
2929
Any scriptblock that should run after importing the module.
3030
Only used when importing modules using the "Invoke-ModuleDebug" funtion, as his used for modules set to auto-import.
31+
32+
.PARAMETER Priority
33+
When importing modules in a debugging context, they are imported in the order of their priority.
34+
The lower the number, the sooner it is imported.
3135
3236
.PARAMETER AllAutoImport
3337
Changes all registered modules to automatically import on powershell launch.
3438
3539
.PARAMETER NoneAutoImport
3640
Changes all registered modules to not automatically import on powershell launch.
41+
42+
.PARAMETER Confirm
43+
If this switch is enabled, you will be prompted for confirmation before executing any operations that change state.
44+
45+
.PARAMETER WhatIf
46+
If this switch is enabled, no actions are performed but informational messages will be displayed that explain what would happen if the command were to run.
3747
3848
.EXAMPLE
3949
PS C:\> Set-PSMDModuleDebug -Name 'cPSNetwork' -AutoImport
@@ -60,7 +70,8 @@
6070
Author: Friedrich Weinmann
6171
Created on: August 7th, 2016
6272
#>
63-
[CmdletBinding(DefaultParameterSetName = "Name")]
73+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]
74+
[CmdletBinding(DefaultParameterSetName = "Name", SupportsShouldProcess = $true)]
6475
Param (
6576
[Parameter(Mandatory = $true, Position = 0, ParameterSetName = "Name")]
6677
[Alias('n')]
@@ -106,25 +117,31 @@
106117
if ($AllAutoImport)
107118
{
108119
$allModules = Import-Clixml $PSModuleDevelopment_ModuleConfigPath
109-
foreach ($module in $allModules)
120+
if ($PSCmdlet.ShouldProcess(($allModules.Name -join ", "), "Configuring modules to automatically import"))
110121
{
111-
$module.AutoImport = $true
122+
foreach ($module in $allModules)
123+
{
124+
$module.AutoImport = $true
125+
}
126+
Export-Clixml -InputObject $allModules -Path $PSModuleDevelopment_ModuleConfigPath
112127
}
113-
Export-Clixml -InputObject $allModules -Path $PSModuleDevelopment_ModuleConfigPath
114128
}
115129
#endregion AllAutoImport
116130

117-
#region AllAutoImport
131+
#region NoneAutoImport
118132
if ($NoneAutoImport)
119133
{
120134
$allModules = Import-Clixml $PSModuleDevelopment_ModuleConfigPath
121-
foreach ($module in $allModules)
135+
if ($PSCmdlet.ShouldProcess(($allModules.Name -join ", "), "Configuring modules to not automatically import"))
122136
{
123-
$module.AutoImport = $false
137+
foreach ($module in $allModules)
138+
{
139+
$module.AutoImport = $false
140+
}
141+
Export-Clixml -InputObject $allModules -Path $PSModuleDevelopment_ModuleConfigPath
124142
}
125-
Export-Clixml -InputObject $allModules -Path $PSModuleDevelopment_ModuleConfigPath
126143
}
127-
#endregion AllAutoImport
144+
#endregion NoneAutoImport
128145

129146
#region Name
130147
# Import all module-configurations
@@ -133,11 +150,11 @@
133150
# If a configuration already exists, change only those values that were specified
134151
if ($module = $allModules | Where-Object { $_.Name -eq $Name })
135152
{
136-
if ($PSBoundParameters.ContainsKey("AutoImport")) { $module.AutoImport = $AutoImport.ToBool() }
137-
if ($PSBoundParameters.ContainsKey("DebugMode")) { $module.DebugMode = $DebugMode.ToBool() }
138-
if ($PSBoundParameters.ContainsKey("PreImportAction")) { $module.PreImportAction = $PreImportAction }
139-
if ($PSBoundParameters.ContainsKey("PostImportAction")) { $module.PostImportAction = $PostImportAction }
140-
if ($PSBoundParameters.ContainsKey("Priority")) { $module.Priority = $Priority }
153+
if (Test-PSFParameterBinding -ParameterName "AutoImport") { $module.AutoImport = $AutoImport.ToBool() }
154+
if (Test-PSFParameterBinding -ParameterName "DebugMode") { $module.DebugMode = $DebugMode.ToBool() }
155+
if (Test-PSFParameterBinding -ParameterName "PreImportAction") { $module.PreImportAction = $PreImportAction }
156+
if (Test-PSFParameterBinding -ParameterName "PostImportAction") { $module.PostImportAction = $PostImportAction }
157+
if (Test-PSFParameterBinding -ParameterName "Priority") { $module.Priority = $Priority }
141158
}
142159
# If no configuration exists yet, create a new one with all parameters as specified
143160
else
@@ -154,7 +171,10 @@
154171

155172
# Add new module configuration to all (if any) other previous configurations and export it to config file
156173
$newModules = @(($allModules | Where-Object { $_.Name -ne $Name }), $module)
157-
Export-Clixml -InputObject $newModules -Path $PSModuleDevelopment_ModuleConfigPath
174+
if ($PSCmdlet.ShouldProcess($name, "Changing debug settings for module"))
175+
{
176+
Export-Clixml -InputObject $newModules -Path $PSModuleDevelopment_ModuleConfigPath
177+
}
158178
#endregion Name
159179
}
160180
Set-Alias -Name smd -Value Set-PSMDModuleDebug -Option AllScope -Scope Global

PSModuleDevelopment/functions/performance/Measure-PSMDCommandEx.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#>
5555
DynamicParam
5656
{
57-
# Create the dictionary
57+
# Create the dictionary
5858
$______RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary
5959

6060
#region Prepare ScriptBlock Parameter

0 commit comments

Comments
 (0)