.(Join-Path -Path (Split-Path $script:MyInvocation.MyCommand.Path-Parent) -ChildPath ".\any.ps1")
.(Join-Path -Path (Split-Path $script:MyInvocation.MyCommand.Path-Parent) -ChildPath ".\PS.Get-Include.ps1")
Get-Include ".\any1.ps1"
...
Get-Include ".\any2.ps1"
MyUtils/
MyUtils.psd1
MyUtils.psm1
functions/
Get-Something.ps1
Get-SomethingOther.ps1
@{
ModuleVersion = '1.0'
GUID = '72d739dd-bddf-4d7c-a358-1a40e2ff961d'
Description = 'MyUtils module'
NestedModules = @('MyUtils.psm1')
}
Try {
Get-ChildItem "$PSScriptRoot\functions\*.ps1" -Exclude *.tests.ps1 *profile.ps1 |
ForEach-Object {
$Function = $_.Name
. $_.FullName
}
} Catch {
Write-Warning ("{0}: {1}" -f $Function,$_.Exception.Message)
Continue
}
function Get-Something {
param(
$parameter
)
Write-Host "I'm Get-Something with $parameter"
}
Find more questions by tags PowerShell