Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经成功创建了一个远程 PowerShell 会话。我想在远程 powershell 会话中更改 IdleTimeout。我已经运行$pssession -IdleTimeout 18000并收到它正在寻找 cmdlet 的错误。
$pssession -IdleTimeout 18000
变量 $pssession 不是脚本、函数或 cmdlet,因此它不带参数。 New-PSSessionOption有-IdleTimeout参数。将其输出保存到变量中,并在New-PSSession -SessionOption创建会话时将其传递给参数。
New-PSSessionOption
-IdleTimeout
New-PSSession -SessionOption
将您需要的任何其他内容添加到以下命令中:
$a = New-PSSessionOption -IdleTimeout 18000 $pssession = New-PSSession -SessionOption $a