Home > OS >  PowerShell script editor
PowerShell script editor

Time:11-15

 
$the Credential=New - Object System. Management Automation. PSCredential $textbox2. Text, (convertto - securestring $($textbox3. Text) - asplaintext - force)
$PSCMD=netsh advfirewall firewall set name=$textbox4 rule. The Text new action=allow

Invoke the Command - $textbox1 ComputerName. Text - ScriptBlock {netsh advfirewall firewall set rule name='$textbox4. The Text "' new action=allow} - the credential $the credential

$ws=New - Object - ComObject WScript. Shell
$the WSR=$ws popup (" has been successfully modified [" + $textbox1. Text + "] server remote login strategy open, please make sure the correctness ", 5, "" command has been completed, 0 + 64)


$PSCMD=netsh advfirewall firewall set name=$textbox4 rule. The Text new action=allow
Invoke the Command - $textbox1 ComputerName. Text - ScriptBlock {netsh advfirewall firewall set rule name= '. $textbox4 text "' new action=allow} - the credential $the credential

For example textbox4. Text="TCP"
Here whether it's with $PSCMD or direct call textbox4. The text cannot identify the TCP
But the direct write - host $textbox4. Text
The content of the show is indeed a TCP

Do not know to have a great god can help have a look at the CSDN, where the problem is,

CodePudding user response:

Textbox4. Text? Identify what is?
  • Related