From 64c9047010fce2f62128e6f55f0cd6481e37d12a Mon Sep 17 00:00:00 2001 From: Steffen Kampmann Date: Sun, 7 Aug 2022 14:22:44 +0200 Subject: [PATCH 1/3] updated --- .github/workflows/build-validation.yml | 2 +- .github/workflows/pre-release.yml | 2 +- .github/workflows/release.yml | 2 +- .vscode/tasks.json | 4 ++-- tasks/PsBuild.Tasks.ps1 | 26 ++++++++++++++++++++------ 5 files changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-validation.yml b/.github/workflows/build-validation.yml index 363e3f7..396ec9e 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.4.0 diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 8fe3956..0b1fc58 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.4.0 with: module-name: PsSmo secrets: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 842b2a5..6793b1f 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.4.0 with: module-name: PsSmo secrets: diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 751ece7..f95aa31 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -63,7 +63,7 @@ "type": "shell", "command": "Invoke-Pester", "options": { - "cwd": "test" + "cwd": "${workspaceFolder}/test" }, "problemMatcher": "$msCompile", "presentation": { @@ -71,6 +71,6 @@ "showReuseMessage": false }, "dependsOn": "Build" - }, + } ] } diff --git a/tasks/PsBuild.Tasks.ps1 b/tasks/PsBuild.Tasks.ps1 index 0cd32d7..98a60cc 100644 --- a/tasks/PsBuild.Tasks.ps1 +++ b/tasks/PsBuild.Tasks.ps1 @@ -10,29 +10,38 @@ task UpdateBuildTasks { #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/main/GitHub/build-validation-matrix.yml' ` - -OutFile "$PSScriptRoot\..\.github\workflows\build-validation.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/main/GitHub/pre-release-windows.yml' | ForEach-Object { $_ -replace 'MyModuleName', $ModuleName } | - Out-File "$PSScriptRoot\..\.github\workflows\pre-release.yml" -NoNewline + 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/main/GitHub/release-windows.yml' | ForEach-Object { $_ -replace 'MyModuleName', $ModuleName } | - Out-File "$PSScriptRoot\..\.github\workflows\release.yml" -NoNewline + Out-File $file -NoNewline } #endregion #region GitHub Pages task UpdateIndexPage { + New-Item -Type Directory "$PSScriptRoot\..\docs" -ErrorAction SilentlyContinue Invoke-WebRequest ` -Uri 'https://raw.githubusercontent.com/abbgrade/PsBuildTasks/main/docs/index.md' ` -OutFile "$PSScriptRoot\..\docs\index.md" @@ -45,19 +54,24 @@ task UpdateIndexPage { #region GitHub Dependabot task UpdateDependabotConfig { + requires ModuleName + [System.IO.FileInfo] $file = "$PSScriptRoot\..\.github\dependabot.yml" + New-Item -Type Directory $file.Directory -ErrorAction SilentlyContinue Invoke-WebRequest ` -Uri 'https://raw.githubusercontent.com/abbgrade/PsBuildTasks/main/dependabot/dependabot.yml' | ForEach-Object { $_ -replace 'MyModuleName', $ModuleName } | - Out-File "$PSScriptRoot\..\.github\dependabot.yml" -NoNewline + Out-File $file -NoNewline } #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/main/VsCode/tasks.json' ` - -OutFile "$PSScriptRoot\..\.vscode\tasks.json" + -OutFile $file } #endregion @@ -71,4 +85,4 @@ task UpdatePsBuildTasksTasks { #endregion -task UpdatePsBuildTasks -Jobs UpdateBuildTasks, UpdateValidationWorkflow, UpdatePreReleaseWorkflow, UpdateIndexPage, UpdateReleaseWorkflow, UpdateVsCodeTasks, UpdatePsBuildTasksTasks +task UpdatePsBuildTasks -Jobs UpdateBuildTasks, UpdateValidationWorkflow, UpdatePreReleaseWorkflow, UpdateReleaseWorkflow, UpdateIndexPage, UpdateDependabotConfig, UpdateVsCodeTasks, UpdatePsBuildTasksTasks From 9b3e28067e1c1de6246a52a60a028c059150e000 Mon Sep 17 00:00:00 2001 From: Steffen Date: Thu, 18 Aug 2022 10:11:51 +0200 Subject: [PATCH 2/3] added pipeline input for disconnect --- src/PsSmo/DisconnectInstanceCommand.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/PsSmo/DisconnectInstanceCommand.cs b/src/PsSmo/DisconnectInstanceCommand.cs index 73b595d..031ef9c 100644 --- a/src/PsSmo/DisconnectInstanceCommand.cs +++ b/src/PsSmo/DisconnectInstanceCommand.cs @@ -9,6 +9,14 @@ namespace PsSmo public class DisconnectInstanceCommand : ClientCommand { + [Parameter( + Position = 0, + ValueFromPipeline = true + )] + [ValidateNotNullOrEmpty()] + [Alias("Connection")] + public Server Instance { get; set; } = ConnectInstanceCommand.Instance; + protected override void ProcessRecord() { base.ProcessRecord(); From a703d819711ad9748d1cf573d5c5975affcc1f77 Mon Sep 17 00:00:00 2001 From: Steffen Date: Thu, 18 Aug 2022 10:13:40 +0200 Subject: [PATCH 3/3] added pipelining --- docs/Disconnect-SmoInstance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Disconnect-SmoInstance.md b/docs/Disconnect-SmoInstance.md index be21931..d7e453c 100644 --- a/docs/Disconnect-SmoInstance.md +++ b/docs/Disconnect-SmoInstance.md @@ -41,7 +41,7 @@ Aliases: Connection Required: False Position: Named Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByValue) Accept wildcard characters: False ```