-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDemo-NewModuleFromFiles.ps1
More file actions
28 lines (26 loc) · 977 Bytes
/
Demo-NewModuleFromFiles.ps1
File metadata and controls
28 lines (26 loc) · 977 Bytes
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
#requires -version 7.4
#this demo assumes you have the Platyps module and git installed
[CmdletBinding(SupportsShouldProcess)]
Param()
$splat = @{
Description = "Demo exported module"
Files = "$PSScriptRoot\tools.psm1"
Layout = "$PSScriptRoot\ModuleLayout.json"
NewModuleName = "PSFooExport"
ParentPath = $env:temp
CreateHelp = $True
FunctionPath = "functions\public"
InitializeGit = $True
}
Clear-Host
Write-Host "Using these parameters" -ForegroundColor yellow
$splat | Out-String | Write-Host -ForegroundColor yellow
Write-Host "WhatIf = $WhatIfPreference" -ForegroundColor yellow
pause
Write-Host "Creating new module from files" -ForegroundColor Green
New-ModuleFromFiles @splat
$newModulePath = Join-Path -Path $splat.ParentPath -ChildPath $splat.NewModuleName
Write-Host "New module created in newModulePath" -ForegroundColor Green
if (-Not $WhatIfPreference) {
Get-ChildItem -Path $newModulePath -Recurse
}