-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathdebugHarness.ps1
More file actions
67 lines (59 loc) · 2.26 KB
/
debugHarness.ps1
File metadata and controls
67 lines (59 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Use this file to debug the module.
if ($null -eq $env:BHProjectPath) {
$path = Join-Path -Path $PSScriptRoot -ChildPath '..\build.ps1'
. $path -Task Build
}
$manifest = Import-PowerShellDataFile -Path $env:BHPSModuleManifest
$outputDir = Join-Path -Path $env:BHProjectPath -ChildPath 'Output'
$outputModDir = Join-Path -Path $outputDir -ChildPath $env:BHProjectName
$outputModVerDir = Join-Path -Path $outputModDir -ChildPath $manifest.ModuleVersion
$outputModVerManifest = Join-Path -Path $outputModVerDir -ChildPath "$($env:BHProjectName).psd1"
Get-Module $env:BHProjectName | Remove-Module -Force -ErrorAction Ignore
Import-Module -Name $outputModVerManifest -Verbose:$false -ErrorAction Stop
#region Setup Output Directory
$OutDir = Join-Path $outputDir "\HarnessOutput"
Remove-Item $OutDir -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Path $OutDir | Out-Null
#endregion Setup Output Directory
# Various debug scenarios other than running Invoke-Plaster.
# Invoke-Pester $PSScriptRoot\test
# Test-PlasterManifest "$PSScriptRoot\src\Templates\NewModule\plasterManifest.xml" -Verbose
# Invoke-psake $PSScriptRoot\build.psake.ps1 -taskList BuildHelp
# return
# $PlasterParams = @{
# TemplatePath = "$PSScriptRoot\src\Templates\AddPSScriptAnalyzerSettings"
# DestinationPath = $OutDir
# FileName = 'PSScriptAnalyzerSettings.psd1'
# Editor = 'VSCode'
# PassThru = $true
# }
$PlasterParams = @{
TemplatePath = "$PSScriptRoot\Plaster\Templates\NewPowerShellScriptModule"
DestinationPath = $OutDir
ModuleName = 'FooUtils'
Version = '1.2.0'
Editor = 'VSCode'
PassThru = $true
}
# $PlasterParams = @{
# TemplatePath = "$PSScriptRoot\examples\NewDscResourceScript"
# DestinationPath = $OutDir
# TargetResourceName = 'ZipFile'
# Ensure = 'Yes'
# PassThru = $true
# }
# $PlasterParams = @{
# TemplatePath = "$PSScriptRoot\examples\NewModule"
# DestinationPath = $OutDir
# ModuleName = 'FooUtils'
# ModuleDesc = 'Utilities for Foo.'
# FullName = 'John Q. Doe'
# Version = '1.2.0'
# Options = 'Git','psake','Pester','PSScriptAnalyzer','platyPS'
# Editor = 'VSCode'
# License = 'MIT'
# PassThru = $true
# }
$obj = Invoke-Plaster @PlasterParams -WhatIf
"PassThru object is:"
$obj