Skip to content

Commit

Permalink
new: Micro.Module.psm1
Browse files Browse the repository at this point in the history
  • Loading branch information
ninmonkey committed Nov 16, 2023
1 parent 2246890 commit 54cf7ac
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Pwsh/Functions/Micro.Module.psm1
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
$script:ModConfig = @{
ExitEarly = $True
}
function Private.Init {
'module::Init' | write-verbose -verbose
'toggle exitting early by setting: $ENV:ModConfigDisableEarlyExit = 1' | Write-Verbose -verbose

$Script:ModConfig.StartTime = Get-Date

if( $ENV:ModConfigDisableEarlyExit ) {
$Script:ModConfig.ExitEarly = $false
}

}
function Mod.Status {
'module::Status' | write-verbose -verbose

'elapsed: {0}' -f @(
(get-date) - $script:ModConfig.StartTime
)
}


Export-ModuleMember -Function @(
'Mod.Status'
)

Private.Init

if( $script:ModConfig.ExitEarly ) {
write-verbose -verbose 'Module::exit early'
return
}

write-verbose -verbose 'Module::ReachedEnd'

0 comments on commit 54cf7ac

Please sign in to comment.