Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在powershell中使用工作流会话时命令消失_Powershell_Powershell Remoting_Powershell Workflow - Fatal编程技术网

在powershell中使用工作流会话时命令消失

在powershell中使用工作流会话时命令消失,powershell,powershell-remoting,powershell-workflow,Powershell,Powershell Remoting,Powershell Workflow,在powershell中使用工作流会话时,大多数常用命令似乎都消失了: PS P:\> $session = New-PSWorkflowSession -ThrottleLimit 3 PS P:\> Invoke-Command $session {Write-Output "test"} The term 'Write-Output' is not recognized as the name of a cmdlet, function, script file, or op

在powershell中使用工作流会话时,大多数常用命令似乎都消失了:

PS P:\> $session = New-PSWorkflowSession -ThrottleLimit 3
PS P:\> Invoke-Command $session {Write-Output "test"}

The term 'Write-Output' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
 + CategoryInfo         : ObjectNotFound: (Write-Output:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
+ PSComputerName        : localhost

如何通过会话使工作流中的所有常用命令正常可用?

由于您使用的是工作流会话,因此您需要将命令放入工作流中

$session = New-PSWorkflowSession -ThrottleLimit 3

Invoke-Command $session {
        workflow test {
            Write-Output -Input "test"
        }
        test
    }
有关更多信息,请查看并