Powershell 远程配置文件 [英] Powershell Remoting Profiles

查看:55
本文介绍了Powershell 远程配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在本地计算机上使用 Enter-PSSession 打开远程 PowerShell 会话时,如何使用远程计算机上我的配置文件中的函数.

How do I use a function in my profile on the remote machine when using Enter-PSSession on my local machine to open a remote PowerShell session.

推荐答案

你不能.使用 enter-pssession 启动远程交互会话时,会加载远程配置文件.此外,仅加载 $pshome 中的机器级配置文件.如果您希望远程功能可用,您必须在远程会话配置的启动脚本中初始化它们.查看远程服务器上的 get/set-pssessionconfiguration.

You can't. When starting a remote interactive session with enter-pssession, a remote profile is loaded. Additionally, only the machine-level profile in $pshome is loaded. If you want remote functions available you'll have to initialize them in the startup script of the remote session configuration. Have a look at get/set-pssessionconfiguration on the remote server.

这篇关于Powershell 远程配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆