获取Stop-NlbClusterNode:找不到与参数名称“Credential”相匹配的参数。 停止节点时出现错误

我正在使用以下脚本来停止计算机上的节点。 但是得到Stop-NlbClusterNode:找不到与参数名称“Credential”匹配的参数。 使用Power-shell脚本和Windows 2012停止节点时出现错误。另外,如何在此脚本中传递密码。 请指导。

#This script monitors stopped application pools along with websites on the current host $RemoteHostName = "testserver" #set hostname #import NLB module. In PS v3 these lines should be redundant and can be removed. import-module NetworkLoadBalancingClusters "Networking Load Balancing Clusters Module imported" # requests the user's credentials and assigns the credentials to an object $Credential = Get-Credential "domain\testuser" "Get credentials for test user done" #uses the nlb cmdlets to check the state of the current cluster $clusterstatus = get-nlbclusternode -nodename $RemoteHostName [string]$status = $clusterstatus | select -expand state "Got the status of cluster $clusterstatus" #if the node has already been stopped dont do anything if ($status -eq "Stopped") { #donothing "Node alrerady stopped" } #if the node hasnt been stopped, stop the node and then send an email out else { "Starting to drain stop the node" stop-NlbClusterNode -HostName $RemoteHostName -Credential $Credential -Drain } 

开始睡觉30

Solutions Collecting From Web of "获取Stop-NlbClusterNode:找不到与参数名称“Credential”相匹配的参数。 停止节点时出现错误"