-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/PSDriveInPath
- Loading branch information
Showing
32 changed files
with
725 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,64 @@ | ||
#Get public and private function definition files. | ||
$Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue ) | ||
$Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue ) | ||
$ModuleRoot = $PSScriptRoot | ||
$Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue ) | ||
$Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue ) | ||
# $ModuleRoot = $PSScriptRoot | ||
|
||
#Dot source the files | ||
Foreach($import in @($Public + $Private)) | ||
Foreach($import in @($Public + $Private)) | ||
{ | ||
Try | ||
{ | ||
Try | ||
{ | ||
. $import.fullname | ||
} | ||
Catch | ||
{ | ||
Write-Error -Message "Failed to import function $($import.fullname): $_" | ||
} | ||
. $import.fullname | ||
} | ||
Catch | ||
{ | ||
Write-Error -Message "Failed to import function $($import.fullname): $_" | ||
} | ||
} | ||
|
||
# Load dependencies. TODO: Move to module dependency once the bug that | ||
# causes this is fixed: https://ci.appveyor.com/project/RamblingCookieMonster/buildhelpers/build/1.0.22 | ||
# Thanks to Joel Bennett for this! | ||
Import-Module $PSScriptRoot\Private\Modules\Configuration | ||
$fallbackModule = Get-Module -Name $PSScriptRoot\Private\Modules\Configuration -ListAvailable | ||
if ($configModule = Get-Module $fallbackModule.Name -ListAvailable) | ||
{ | ||
$configModule | | ||
Where-Object { $_.Version -gt $fallbackModule.Version} | | ||
Sort-Object -Property Version -Descending | | ||
Select-Object -First 1 | | ||
Import-Module -Force | ||
} | ||
if (-not (Get-Module $fallbackModule.Name | Where-Object { $_.Version -gt $fallbackModule.Version})) | ||
{ | ||
$fallbackModule | Import-Module -Force | ||
} | ||
|
||
Export-ModuleMember -Function $Public.Basename | ||
Export-ModuleMember -Function Get-Metadata, Update-Metadata, Export-Metadata | ||
|
||
# Set aliases (#10) | ||
Set-Alias -Name Set-BuildVariable -Value $PSScriptRoot\Scripts\Set-BuildVariable.ps1 | ||
Export-ModuleMember -Alias Set-BuildVariable | ||
Set-Alias -Name Get-NextPSGalleryVersion -Value Get-NextNugetPackageVersion | ||
# Backwards compatibilty to command names prior to #72 | ||
Set-Alias -Name Get-BuildVariables -Value Get-BuildVariable | ||
Set-Alias -Name Get-ModuleAliases -Value Get-ModuleAlias | ||
Set-Alias -Name Get-ModuleFunctions -Value Get-ModuleFunction | ||
Set-Alias -Name Set-ModuleAliases -Value Set-ModuleAlias | ||
Set-Alias -Name Set-ModuleFormats -Value Set-ModuleFormat | ||
Set-Alias -Name Set-ModuleFunctions -Value Set-ModuleFunction | ||
Set-Alias -Name Set-ModuleTypes -Value Set-ModuleType | ||
|
||
$exportModuleMemberSplat = @{ | ||
Alias = @( | ||
'Set-BuildVariable' | ||
'Get-NextPSGalleryVersion' | ||
'Get-BuildVariables' | ||
'Get-ModuleAliases' | ||
'Get-ModuleFunctions' | ||
'Set-ModuleAliases' | ||
'Set-ModuleFormats' | ||
'Set-ModuleFunctions' | ||
'Set-ModuleTypes' | ||
) | ||
} | ||
Export-ModuleMember @exportModuleMemberSplat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.