attach functional
This commit is contained in:
@@ -1,19 +1,26 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[Parameter(Mandatory = $true, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $false)]
|
||||
[string]$WorkerName,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[Parameter(Mandatory = $true, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $false)]
|
||||
[string]$WorkerType,
|
||||
|
||||
[Parameter(ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $false)]
|
||||
[string]$DataRoot = (Join-Path ([Environment]::GetFolderPath('LocalApplicationData')) 'UnifiedWorkers'),
|
||||
|
||||
[Parameter(ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $false)]
|
||||
[switch]$CommandOnly,
|
||||
|
||||
[Parameter(ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $false)]
|
||||
[string]$Command
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Continue'
|
||||
|
||||
# Explicitly clear any pipeline input to prevent binding errors
|
||||
$null = $input
|
||||
|
||||
# Ensure we can see output immediately
|
||||
try {
|
||||
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
|
||||
Reference in New Issue
Block a user