MyBudgetPowerShellModule.psm1
|
# MyBudgetPowerShellModule # PowerShell module for personal budget management # Get the module root path $ModuleRoot = $PSScriptRoot # Import Private functions (classes and helpers) $PrivatePath = Join-Path -Path $ModuleRoot -ChildPath 'Private' if (Test-Path $PrivatePath) { Get-ChildItem -Path $PrivatePath -Filter '*.ps1' -Recurse | ForEach-Object { . $_.FullName } } # Import Public functions $PublicPath = Join-Path -Path $ModuleRoot -ChildPath 'Public' if (Test-Path $PublicPath) { Get-ChildItem -Path $PublicPath -Filter '*.ps1' -Recurse | ForEach-Object { . $_.FullName } } # Set default data directory $script:DefaultDataPath = Join-Path -Path $HOME -ChildPath '.mybudget' if (-not (Test-Path $script:DefaultDataPath)) { New-Item -Path $script:DefaultDataPath -ItemType Directory -Force | Out-Null } # Export module members Export-ModuleMember -Function @( 'Initialize-BudgetWorkspace', 'New-Budget', 'Get-Budget', 'Get-ActiveBudget', 'Set-ActiveBudget', 'Remove-Budget', 'New-Biller', 'Get-Biller', 'Set-Biller', 'Remove-Biller', 'New-Earning', 'Get-Earning', 'Set-Earning', 'Remove-Earning', 'New-Account', 'Get-Account', 'Set-Account', 'Remove-Account', 'Get-ProjectedTransactions', 'Export-ProjectedTransactions' ) |