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/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 ``` 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(); 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