[英]powershell new-item with -value and sub parameter
我想为以下命令添加别名:
new-item -path alias:rmn -value "Enter-PSSession -ComputerName NUC"
要奏效,必须做些什么?
那不是在PowerShell中使用什么别名。 您需要为此创建函数:
function rmn {
Enter-PSSession -ComputerName NUC
}
别名仅用于命令,不能将参数与别名一起使用
或者,您可以创建别名rmn作为enter-pssession
并按如下方式使用它:
rmn -computername nuc
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.