diff --git a/.build.ps1 b/.build.ps1 index 21d5ff9..427cf7e 100644 --- a/.build.ps1 +++ b/.build.ps1 @@ -27,34 +27,9 @@ param( $ModuleName = 'psdocker' -. $PSScriptRoot\Tasks\Dependencies.Tasks.ps1 -. $PSScriptRoot\Tasks\Build.Tasks.ps1 +. $PSScriptRoot\tasks\Build.Tasks.ps1 +. $PSScriptRoot\tasks\Dependencies.Tasks.ps1 +. $PSScriptRoot\tasks\PsBuild.Tasks.ps1 # Synopsis: Default task. task . Build - -task UpdateBuildTasks { - Invoke-WebRequest ` - -Uri 'https://raw.githubusercontent.com/abbgrade/PsBuildTasks/main/Powershell/Build.Tasks.ps1' ` - -OutFile "$PSScriptRoot\Tasks\Build.Tasks.ps1" -} - -task UpdateValidationWorkflow { - Invoke-WebRequest ` - -Uri 'https://raw.githubusercontent.com/abbgrade/PsBuildTasks/main/GitHub/build-validation-matrix.yml' ` - -OutFile "$PSScriptRoot\.github\workflows\build-validation.yml" -} - -task UpdatePreReleaseWorkflow { - Invoke-WebRequest ` - -Uri 'https://raw.githubusercontent.com/abbgrade/PsBuildTasks/main/GitHub/pre-release-windows.yml' ` - -OutFile "$PSScriptRoot\.github\workflows\pre-release.yml" -} - -task UpdateReleaseWorkflow { - Invoke-WebRequest ` - -Uri 'https://raw.githubusercontent.com/abbgrade/PsBuildTasks/main/GitHub/release-windows.yml' ` - -OutFile "$PSScriptRoot\.github\workflows\release.yml" -} - -task UpdatePsBuildTasks -Jobs UpdateBuildTasks, UpdateValidationWorkflow, UpdatePreReleaseWorkflow, UpdateReleaseWorkflow diff --git a/.github/workflows/build-pages.yml b/.github/workflows/build-pages.yml new file mode 100644 index 0000000..b717070 --- /dev/null +++ b/.github/workflows/build-pages.yml @@ -0,0 +1,47 @@ +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./ + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/.github/workflows/build-validation.yml b/.github/workflows/build-validation.yml index 363e3f7..f8eae9f 100644 --- a/.github/workflows/build-validation.yml +++ b/.github/workflows/build-validation.yml @@ -6,4 +6,4 @@ on: jobs: build-validation: - uses: abbgrade/PsBuildTasks/.github/workflows/build-validation-matrix.yml@v1.1 + uses: abbgrade/PsBuildTasks/.github/workflows/build-validation-matrix.yml@1.8.2 diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 03c3379..1b1045d 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -5,7 +5,7 @@ on: jobs: pre-release: - uses: abbgrade/PsBuildTasks/.github/workflows/pre-release-windows.yml@v1.1 + uses: abbgrade/PsBuildTasks/.github/workflows/pre-release-windows.yml@1.8.2 with: module-name: psdocker secrets: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d2c1f7..2417d24 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: jobs: release: - uses: abbgrade/PsBuildTasks/.github/workflows/release-windows.yml@v1.1 + uses: abbgrade/PsBuildTasks/.github/workflows/release-windows.yml@1.8.2 with: module-name: psdocker secrets: diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 061c42a..f95aa31 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -48,7 +48,7 @@ { "label": "Install", "type": "shell", - "command": "Invoke-Build Clean, Install", + "command": "Invoke-Build Install", "problemMatcher": [] }, { @@ -62,9 +62,6 @@ "group": "test", "type": "shell", "command": "Invoke-Pester", - "args": [ - "-Output", "Detailed" - ], "options": { "cwd": "${workspaceFolder}/test" }, @@ -73,7 +70,7 @@ "echo": false, "showReuseMessage": false }, - "dependsOn": "Rebuild" - }, + "dependsOn": "Build" + } ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index a2ab725..51822a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- New-Image command to build an image. + ## [1.7.0] - 2022-02-26 ### Added diff --git a/README.md b/README.md index 39c68fc..5648269 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,18 @@ -# psdocker +# Readme [![.github/workflows/build-validation.yml](https://github.com/abbgrade/psdocker/actions/workflows/build-validation.yml/badge.svg?branch=develop)](https://github.com/abbgrade/psdocker/actions/workflows/build-validation.yml) +For details, visit the [GitHub Pages](https://abbgrade.github.io/psdocker/). + ## Installation Make sure that the docker cli is installed. e.g. from [Chocolatey](https://chocolatey.org/packages/docker-cli) or with [Docker Desktop](https://hub.docker.com/editions/community/docker-ce-desktop-windows/). Install psdocker from [PowerShell Gallery](https://www.powershellgallery.com/packages/psdocker) using a PowerShell command line: - Install-Module -Name psdocker -Scope CurrentUser +```powershell +Install-Module -Name psdocker -Scope CurrentUser +``` ## Build @@ -35,7 +39,7 @@ For debugging tests change the working directory to ./src/test create the breakp ## Usage -See the folder [docs](./docs) for examples. +See [the command reference](./docs/) for descriptions and examples. ## Changelog diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..fff4ab9 --- /dev/null +++ b/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-minimal diff --git a/Docs/Get-DockerContainer.md b/docs/Get-DockerContainer.md similarity index 100% rename from Docs/Get-DockerContainer.md rename to docs/Get-DockerContainer.md diff --git a/Docs/Get-DockerImage.md b/docs/Get-DockerImage.md similarity index 100% rename from Docs/Get-DockerImage.md rename to docs/Get-DockerImage.md diff --git a/Docs/Get-DockerVersion.md b/docs/Get-DockerVersion.md similarity index 100% rename from Docs/Get-DockerVersion.md rename to docs/Get-DockerVersion.md diff --git a/Docs/Install-DockerImage.md b/docs/Install-DockerImage.md similarity index 100% rename from Docs/Install-DockerImage.md rename to docs/Install-DockerImage.md diff --git a/Docs/Invoke-DockerCommand.md b/docs/Invoke-DockerCommand.md similarity index 100% rename from Docs/Invoke-DockerCommand.md rename to docs/Invoke-DockerCommand.md diff --git a/Docs/New-DockerContainer.md b/docs/New-DockerContainer.md similarity index 100% rename from Docs/New-DockerContainer.md rename to docs/New-DockerContainer.md diff --git a/docs/New-DockerImage.md b/docs/New-DockerImage.md new file mode 100644 index 0000000..cac0376 --- /dev/null +++ b/docs/New-DockerImage.md @@ -0,0 +1,108 @@ +--- +external help file: psdocker-help.xml +Module Name: psdocker +online version: https://docs.docker.com/engine/reference/commandline/run/ +schema: 2.0.0 +--- + +# New-DockerImage + +## SYNOPSIS +{{ Fill in the Synopsis }} + +## SYNTAX + +``` +New-DockerImage [-Repository] [[-Tag] ] [[-Path] ] [[-Timeout] ] + [] +``` + +## DESCRIPTION +{{ Fill in the Description }} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -Path +{{ Fill Path Description }} + +```yaml +Type: DirectoryInfo +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Repository +{{ Fill Repository Description }} + +```yaml +Type: String +Parameter Sets: (All) +Aliases: Name + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Tag +{{ Fill Tag Description }} + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Timeout +{{ Fill Timeout Description }} + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +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 + +### System.String + +### System.IO.DirectoryInfo + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS diff --git a/Docs/Remove-DockerContainer.md b/docs/Remove-DockerContainer.md similarity index 100% rename from Docs/Remove-DockerContainer.md rename to docs/Remove-DockerContainer.md diff --git a/Docs/Search-DockerRepository.md b/docs/Search-DockerRepository.md similarity index 100% rename from Docs/Search-DockerRepository.md rename to docs/Search-DockerRepository.md diff --git a/Docs/Stop-DockerContainer.md b/docs/Stop-DockerContainer.md similarity index 100% rename from Docs/Stop-DockerContainer.md rename to docs/Stop-DockerContainer.md diff --git a/Docs/Uninstall-DockerImage.md b/docs/Uninstall-DockerImage.md similarity index 100% rename from Docs/Uninstall-DockerImage.md rename to docs/Uninstall-DockerImage.md diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..d1f3aaf --- /dev/null +++ b/docs/index.md @@ -0,0 +1,9 @@ +# Commands + +
    +{% for page in site.pages %} +{% if page.title and page.title != 'Commands' and page.dir == '/docs/' %} +
  • {{ page.title }}
  • +{% endif %} +{% endfor %} +
diff --git a/Source/Internal/Container.ps1 b/src/Internal/Container.ps1 similarity index 100% rename from Source/Internal/Container.ps1 rename to src/Internal/Container.ps1 diff --git a/Source/Internal/ContainerNameCompleter.ps1 b/src/Internal/ContainerNameCompleter.ps1 similarity index 100% rename from Source/Internal/ContainerNameCompleter.ps1 rename to src/Internal/ContainerNameCompleter.ps1 diff --git a/Source/Internal/Convert-ToTable.ps1 b/src/Internal/Convert-ToTable.ps1 similarity index 100% rename from Source/Internal/Convert-ToTable.ps1 rename to src/Internal/Convert-ToTable.ps1 diff --git a/Source/Internal/Image.ps1 b/src/Internal/Image.ps1 similarity index 100% rename from Source/Internal/Image.ps1 rename to src/Internal/Image.ps1 diff --git a/Source/Internal/ImageNameCompleter.ps1 b/src/Internal/ImageNameCompleter.ps1 similarity index 100% rename from Source/Internal/ImageNameCompleter.ps1 rename to src/Internal/ImageNameCompleter.ps1 diff --git a/Source/Internal/Invoke-ClientCommand.ps1 b/src/Internal/Invoke-ClientCommand.ps1 similarity index 100% rename from Source/Internal/Invoke-ClientCommand.ps1 rename to src/Internal/Invoke-ClientCommand.ps1 diff --git a/Source/Internal/Repository.ps1 b/src/Internal/Repository.ps1 similarity index 100% rename from Source/Internal/Repository.ps1 rename to src/Internal/Repository.ps1 diff --git a/Source/Internal/RepositoryCompleter.ps1 b/src/Internal/RepositoryCompleter.ps1 similarity index 100% rename from Source/Internal/RepositoryCompleter.ps1 rename to src/Internal/RepositoryCompleter.ps1 diff --git a/Source/Internal/TagCompleter.ps1 b/src/Internal/TagCompleter.ps1 similarity index 100% rename from Source/Internal/TagCompleter.ps1 rename to src/Internal/TagCompleter.ps1 diff --git a/Source/Public/Get-Container.ps1 b/src/Public/Get-Container.ps1 similarity index 100% rename from Source/Public/Get-Container.ps1 rename to src/Public/Get-Container.ps1 diff --git a/Source/Public/Get-Image.ps1 b/src/Public/Get-Image.ps1 similarity index 100% rename from Source/Public/Get-Image.ps1 rename to src/Public/Get-Image.ps1 diff --git a/Source/Public/Get-Version.ps1 b/src/Public/Get-Version.ps1 similarity index 100% rename from Source/Public/Get-Version.ps1 rename to src/Public/Get-Version.ps1 diff --git a/Source/Public/Install-Image.ps1 b/src/Public/Install-Image.ps1 similarity index 100% rename from Source/Public/Install-Image.ps1 rename to src/Public/Install-Image.ps1 diff --git a/Source/Public/Invoke-Command.ps1 b/src/Public/Invoke-Command.ps1 similarity index 100% rename from Source/Public/Invoke-Command.ps1 rename to src/Public/Invoke-Command.ps1 diff --git a/Source/Public/New-Container.ps1 b/src/Public/New-Container.ps1 similarity index 100% rename from Source/Public/New-Container.ps1 rename to src/Public/New-Container.ps1 diff --git a/src/Public/New-Image.ps1 b/src/Public/New-Image.ps1 new file mode 100644 index 0000000..66637c1 --- /dev/null +++ b/src/Public/New-Image.ps1 @@ -0,0 +1,29 @@ +function New-Image { + + [CmdletBinding()] + param ( + [Parameter( Mandatory, ValueFromPipelineByPropertyName = $true )] + [Alias( 'Name' )] + [ValidateNotNullOrEmpty()] + [string] $Repository, + + [Parameter( ValueFromPipelineByPropertyName = $true )] + [ValidateNotNullOrEmpty()] + [string] $Tag = 'latest', + + [Parameter( ValueFromPipelineByPropertyName = $true )] + [ValidateScript({ $_.Exists })] + [System.IO.DirectoryInfo] $Path, + + [Parameter()] + [int] $Timeout = 10 + ) + + process { + $arguments = New-Object System.Collections.ArrayList + $arguments.Add("-t $( $Repository ):$Tag") | Out-Null + $arguments.Add("$Path") | Out-Null + + Invoke-ClientCommand "build", $arguments -Timeout $Timeout | Write-Output + } +} diff --git a/Source/Public/Remove-Container.ps1 b/src/Public/Remove-Container.ps1 similarity index 100% rename from Source/Public/Remove-Container.ps1 rename to src/Public/Remove-Container.ps1 diff --git a/Source/Public/Search-Repository.ps1 b/src/Public/Search-Repository.ps1 similarity index 100% rename from Source/Public/Search-Repository.ps1 rename to src/Public/Search-Repository.ps1 diff --git a/Source/Public/Stop-Container.ps1 b/src/Public/Stop-Container.ps1 similarity index 100% rename from Source/Public/Stop-Container.ps1 rename to src/Public/Stop-Container.ps1 diff --git a/Source/Public/Uninstall-Image.ps1 b/src/Public/Uninstall-Image.ps1 similarity index 100% rename from Source/Public/Uninstall-Image.ps1 rename to src/Public/Uninstall-Image.ps1 diff --git a/Source/psdocker.psd1 b/src/psdocker.psd1 similarity index 100% rename from Source/psdocker.psd1 rename to src/psdocker.psd1 diff --git a/Source/psdocker.psm1 b/src/psdocker.psm1 similarity index 100% rename from Source/psdocker.psm1 rename to src/psdocker.psm1 diff --git a/Tasks/Build.Tasks.ps1 b/tasks/Build.Tasks.ps1 similarity index 73% rename from Tasks/Build.Tasks.ps1 rename to tasks/Build.Tasks.ps1 index 852900b..f336148 100644 --- a/Tasks/Build.Tasks.ps1 +++ b/tasks/Build.Tasks.ps1 @@ -1,14 +1,17 @@ +# Copy from original https://github.com/abbgrade/PsBuildTasks/blob/main/Powershell/Build.Tasks.ps1 + requires ModuleName -[System.IO.DirectoryInfo] $SourceDirectory = "$PsScriptRoot\..\Source" -[System.IO.DirectoryInfo] $SourceManifest = "$SourceDirectory\$ModuleName.psd1" -[System.IO.DirectoryInfo] $PublishDirectory = "$PsScriptRoot\..\publish" -[System.IO.DirectoryInfo] $DocumentationDirectory = "$PsScriptRoot\..\Docs" -[System.IO.DirectoryInfo] $ModulePublishDirectory = "$PublishDirectory\$ModuleName" +[System.IO.DirectoryInfo] $SourceDirectory = "$PsScriptRoot/../src" +[System.IO.DirectoryInfo] $SourceManifest = "$SourceDirectory/$ModuleName.psd1" +[System.IO.DirectoryInfo] $PublishDirectory = "$PsScriptRoot/../publish" +[System.IO.DirectoryInfo] $DocumentationDirectory = "$PsScriptRoot/../docs" +[System.IO.DirectoryInfo] $ModulePublishDirectory = "$PublishDirectory/$ModuleName" # Synopsis: Remove all temporary files. task Clean -Jobs { - remove $PublishDirectory, $DocumentationDirectory + remove $PublishDirectory + $DocumentationDirectory | Get-ChildItem -Exclude index.md, _config.yml | Remove-item } # Synopsis: Import the module. @@ -49,16 +52,19 @@ task SetPrerelease -If $BuildNumber { # Synopsis: Build the module. task Build -Jobs Clean, Doc.Update, PreparePublishDirectory, { Copy-Item -Path $SourceDirectory -Destination $ModulePublishDirectory -Recurse - [System.IO.FileInfo] $Global:Manifest = "$ModulePublishDirectory\$ModuleName.psd1" + [System.IO.FileInfo] $Global:Manifest = "$ModulePublishDirectory/$ModuleName.psd1" }, SetPrerelease # Synopsis: Install the module. task Install -Jobs Build, { $info = Import-PowerShellDataFile $Global:Manifest $version = ([System.Version] $info.ModuleVersion) - $defaultModulePath = $env:PsModulePath -split ';' | Select-Object -First 1 - Write-Verbose "install $ModuleName $version to $defaultModulePath" - $installPath = Join-Path $defaultModulePath $ModuleName $version.ToString() + $defaultModulePath = $env:PSModulePath -split ';' | Select-Object -First 1 + if ( -not $defaultModulePath ) { + Write-Error "Failed to determine default module path from `$env:PSModulePath='$( $env:PSModulePath )'" + } + Write-Verbose "install $ModuleName $version to '$defaultModulePath'" + $installPath = Join-Path $defaultModulePath $ModuleName $version.ToString() New-Item -Type Directory $installPath -Force | Out-Null Get-ChildItem $Global:Manifest.Directory | Copy-Item -Destination $installPath -Recurse -Force } diff --git a/Tasks/Dependencies.Tasks.ps1 b/tasks/Dependencies.Tasks.ps1 similarity index 100% rename from Tasks/Dependencies.Tasks.ps1 rename to tasks/Dependencies.Tasks.ps1 diff --git a/tasks/PsBuild.Tasks.ps1 b/tasks/PsBuild.Tasks.ps1 new file mode 100644 index 0000000..92769f8 --- /dev/null +++ b/tasks/PsBuild.Tasks.ps1 @@ -0,0 +1,90 @@ + +if ( -Not $PsBuildTaskBranch ) { + $PsBuildTaskBranch = 'main' +} + +#region InvokeBuild + +task UpdateBuildTasks { + Invoke-WebRequest ` + -Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/Powershell/Build.Tasks.ps1" ` + -OutFile "$PSScriptRoot\Build.Tasks.ps1" +} + +#endregion +#region GitHub Actions + +task UpdateValidationWorkflow { + [System.IO.FileInfo] $file = "$PSScriptRoot/../.github/workflows/build-validation.yml" + New-Item -Type Directory $file.Directory -ErrorAction SilentlyContinue + Invoke-WebRequest ` + -Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/GitHub/build-validation-matrix.yml" ` + -OutFile $file +} + +task UpdatePagesWorkflow { + [System.IO.FileInfo] $file = "$PSScriptRoot/../.github/workflows/build-pages.yml" + New-Item -Type Directory $file.Directory -ErrorAction SilentlyContinue + Invoke-WebRequest ` + -Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/GitHub/build-pages.yml" ` + -OutFile $file +} + +task UpdatePreReleaseWorkflow { + requires ModuleName + [System.IO.FileInfo] $file = "$PSScriptRoot\..\.github\workflows\pre-release.yml" + New-Item -Type Directory $file.Directory -ErrorAction SilentlyContinue + Invoke-WebRequest ` + -Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/GitHub/pre-release-windows.yml" | + ForEach-Object { $_ -replace 'MyModuleName', $ModuleName } | + Out-File $file -NoNewline +} + +task UpdateReleaseWorkflow { + requires ModuleName + [System.IO.FileInfo] $file = "$PSScriptRoot\..\.github\workflows\release.yml" + New-Item -Type Directory $file.Directory -ErrorAction SilentlyContinue + Invoke-WebRequest ` + -Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/GitHub/release-windows.yml" | + ForEach-Object { $_ -replace 'MyModuleName', $ModuleName } | + Out-File $file -NoNewline +} + +task UpdateWorkflows -Jobs UpdateValidationWorkflow, UpdatePagesWorkflow, UpdatePreReleaseWorkflow, UpdateReleaseWorkflow + +#endregion +#region GitHub Pages + +task UpdateIndexPage { + New-Item -Type Directory "$PSScriptRoot\..\docs" -ErrorAction SilentlyContinue + Invoke-WebRequest ` + -Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/docs/index.md" ` + -OutFile "$PSScriptRoot\..\docs\index.md" + Invoke-WebRequest ` + -Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/_config.yml" ` + -OutFile "$PSScriptRoot\..\_config.yml" +} + +#endregion +#region VsCode + +task UpdateVsCodeTasks { + [System.IO.FileInfo] $file = "$PSScriptRoot\..\.vscode\tasks.json" + New-Item -Type Directory $file.Directory -ErrorAction SilentlyContinue + Invoke-WebRequest ` + -Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/VsCode/tasks.json" ` + -OutFile $file +} + +#endregion +#region PsBuildTasks + +task UpdatePsBuildTasksTasks { + Invoke-WebRequest ` + -Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/tasks/PowerShell-Matrix.Tasks.ps1" ` + -OutFile "$PSScriptRoot\PsBuild.Tasks.ps1" +} + +#endregion + +task UpdatePsBuildTasks -Jobs UpdateBuildTasks, UpdateWorkflows, UpdateIndexPage, UpdateVsCodeTasks, UpdatePsBuildTasksTasks diff --git a/test/Helper/TestHelper.ps1 b/test/Helper/TestHelper.ps1 index f8ff77f..71fb174 100644 --- a/test/Helper/TestHelper.ps1 +++ b/test/Helper/TestHelper.ps1 @@ -1,6 +1,6 @@ param ( - [string] $ModuleManifestPath = "$PSScriptRoot\..\..\Source\psdocker.psd1" + [string] $ModuleManifestPath = "$PSScriptRoot\..\..\src\psdocker.psd1" ) Import-Module $ModuleManifestPath -Force