TestPowerShellScript.psm1
# Set Strict Mode for Module. https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/set-strictmode Set-StrictMode -Version 3.0 # Dot source all the PowerShell scripts we have in this module Get-ChildItem (Split-Path $script:MyInvocation.MyCommand.Path) -Filter '*.ps1' -Recurse | ForEach-Object { . $_.FullName } # Export the individual functions inside all the PowerShell scripts as members of the parent module Get-ChildItem "$(Split-Path $script:MyInvocation.MyCommand.Path)\*" -Filter '*.ps1' -Recurse | ForEach-Object { Export-ModuleMember -Function $_.BaseName } |