$User=read - host "User name"
$PS=read - host "password"
$IP=read - host "IP address"
$PassWord=ConvertTo - SecureString - String $PS - AsPlainText - Force
$the Credential=New - Object - TypeName "System. Management Automation. PSCredential" - ArgumentList $User and $PassWord
Enter - PSSession $IP - the credential $the credential
The second paragraph
$Server=read - host "service name"
$enalbe=read - host "/block refused to allow permission"
Netsh advfirewall firewall rule name=$Server set new action=$enalbe
Excuse me each great god how to run after the first paragraph, then run the second paragraph, thank you.
CodePudding user response:
Add judgment? The first complete execute the second step is true?