-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
145 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
external help file: PsBuildTasks-help.xml | ||
Module Name: PsBuildTasks | ||
online version: | ||
schema: 2.0.0 | ||
--- | ||
|
||
# Install-PsBuildExtension | ||
|
||
## SYNOPSIS | ||
Installs a PsBuildTasks extension | ||
|
||
## SYNTAX | ||
|
||
``` | ||
Install-PsBuildExtension [-Path] <DirectoryInfo> [-Repository] <String> [<CommonParameters>] | ||
``` | ||
|
||
## DESCRIPTION | ||
{{ Fill in the Description }} | ||
|
||
## EXAMPLES | ||
|
||
### Example 1 | ||
```powershell | ||
PS C:\> {{ Add example code here }} | ||
``` | ||
|
||
{{ Add example description here }} | ||
|
||
## PARAMETERS | ||
|
||
### -Path | ||
Path to the tasks directory. | ||
|
||
```yaml | ||
Type: DirectoryInfo | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: 1 | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -Repository | ||
URL to the git repository. | ||
```yaml | ||
Type: String | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: 2 | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### CommonParameters | ||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). | ||
## INPUTS | ||
## OUTPUTS | ||
## NOTES | ||
## RELATED LINKS |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
function Install-Extension { | ||
|
||
<# | ||
.SYNOPSIS | ||
Installs a PsBuildTasks extension | ||
#> | ||
|
||
[CmdletBinding()] | ||
param ( | ||
# Path to the tasks directory. | ||
[Parameter( Mandatory )] | ||
[System.IO.DirectoryInfo] $Path, | ||
|
||
# URL to the git repository. | ||
[Parameter( Mandatory )] | ||
[string] $Repository | ||
) | ||
|
||
Join-Path $Path tasks | Push-Location | ||
git submodule add $Repository | ||
Pop-Location | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#Requires -Modules @{ ModuleName='Pester'; ModuleVersion='5.0.0' } | ||
|
||
Describe Install-Extension { | ||
|
||
BeforeAll { | ||
Import-Module $PSScriptRoot\..\src\PsBuildTasks.psd1 -Force -ErrorAction Stop -PassThru | ||
} | ||
|
||
It exists { | ||
Get-Command -Module PsBuildTasks -Name Install-PsBuildExtension -ErrorAction Stop | ||
} | ||
|
||
Context Project { | ||
|
||
BeforeAll { | ||
$ProjectPath = "TestDrive:\" | ||
Install-PsBuildTask -Path $ProjectPath -Task PowerShell-Matrix | ||
Push-Location $ProjectPath | ||
git init | ||
Pop-Location | ||
} | ||
|
||
It works { | ||
Install-PsBuildExtension ` | ||
-Path $ProjectPath ` | ||
-Repository 'https://github.com/abbgrade/PsSqlTestTasks.git' ` | ||
-ErrorAction Stop | ||
|
||
$ExtensionPath = Join-Path $ProjectPath tasks PsSqlTestTasks | ||
$ExtensionPath | Should -Exist | ||
|
||
$TaskPath = Join-Path $ExtensionPath WideWorldImporters.Tasks.ps1 | ||
$TaskPath | Should -Exist | ||
|
||
$GitModules = Join-Path $ProjectPath .gitmodules | ||
$GitModules | Should -Exist | ||
} | ||
|
||
} | ||
|
||
} |