-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.ps1
More file actions
16 lines (15 loc) · 863 Bytes
/
main.ps1
File metadata and controls
16 lines (15 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidUsingWriteHost', '',
Justification = 'Wriite to the GitHub Actions log, not the pipeline.'
)]
[CmdletBinding()]
param()
$PSModulePath = $env:PSModulePath -split [System.IO.Path]::PathSeparator | Select-Object -First 1
Remove-Module -Name Helpers -Force -ErrorAction SilentlyContinue
Get-Command -Module Helpers | ForEach-Object { Remove-Item -Path function:$_ -Force }
Get-Item -Path "$PSModulePath/Helpers/999.0.0" -ErrorAction SilentlyContinue | Remove-Item -Recurse -Force
$modulePath = New-Item -Path "$PSModulePath/Helpers/999.0.0" -ItemType Directory -Force | Select-Object -ExpandProperty FullName
Copy-Item -Path "$PSScriptRoot/Helpers/*" -Destination $modulePath -Recurse -Force
Write-Host '::group::Importing helpers'
Import-Module -Name Helpers -Verbose
Write-Host '::endgroup::'