PowerHunt icon indicating copy to clipboard operation
PowerHunt copied to clipboard

Fails creating PS Remoting Target List

Open lynnewu opened this issue 3 years ago • 1 comments

This is in PowerShell 5. Also fails, for a different reason, PowerShell 7. (will create separate issue for that)

 -------------------------------------------
 DISCOVERY: PORT SCANNING (5985/5986)
 -------------------------------------------
 [*][10/19/2022 12:42] Checking if TCP Port 5985 (NonSSL) is open on 523 computers
 [*][10/19/2022 12:44] - 383 computers have TCP port 5985 open.
 [*][10/19/2022 12:44] Checking if TCP Port 5986 (SSL) is open on 523 computers
 [*][10/19/2022 12:46] - 1 computers have TCP port 5986 open.
 [*][10/19/2022 12:46] Creating PS Remoting Target List.
Method invocation failed because [System.Management.Automation.PSObject] does not contain a method named 'op_Addition'.
At C:\src\PowerHunt\PowerHunt.psm1:569 char:17
+ ...             $PsRemotingTargetsAll = $Computers5986Open + $Computers59 ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (op_Addition:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

 [*][10/19/2022 12:46] - 0 computers will be targeted.
 -------------------------------------------
 COLLECTION: ESTABLISH PS REMOTING SESSIONS
 -------------------------------------------
 [*][10/19/2022 12:46] - Attempting to establish PS Remoting sessions with 0 computers.
 [*][10/19/2022 12:46] - 0 PS Remoting sessions were established.
 [!][10/19/2022 12:46] - Aborting operation.

Environment

PS C:\src\PowerHunt> get-host

Name             : ConsoleHost
Version          : 5.1.19041.1682
InstanceId       : 08f5f660-e382-4667-b05b-9316b89b6728
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

lynnewu avatar Oct 19 '22 18:10 lynnewu

Odd, i tested it using PowerShell 5, but I'll take another look. I obviously missed a bug. Thanks again.

nullbind avatar Jan 11 '23 17:01 nullbind