Daybreak Faction - Puzzle 4

This topic contains 1 reply, has 2 voices, and was last updated by  js 3 months, 1 week ago.

  • Author
    Posts
  • #92946

    Josh Rickard
    Participant

    I wanted to go ahead and start this thread, even though my solution is NOT complete. If you're interested in my approach up to this point, please see this link: https://github.com/MSAdministrator/PSNetStat

  • #93511

    js
    Participant

    Learning how the convertfrom-string templates work. 🙂 Two line templates work better.

    $template = @'
      {ip*:872.16.173.1}          {mac:9c-45-27-1d-a7-60}     {type:dynamic}
      {ip*:872.16.173.8}          {mac:a8-ca-3a-85-a2-53}     {type:dynamic}
    '@
    
    arp -a | convertfrom-string -templatecontent $template | ft
    
    $template = @'
      {Proto*:TCP}    {LocalAddress:127.0.0.1:5354}         {ForeignAddress:TOM:49673}          {State:ESTABLISHED}
      {Proto*:TCP}    {LocalAddress:127.0.0.1:5354}         {ForeignAddress:TOM:49674}          {State:ESTABLISHED}
    '@
    
    netstat | convertfrom-string -templatecontent $template | ft
    
    $template = @'
       IPv4 Address. . . . . . . . . . . : {ip*:172.16.173.105}
       Subnet Mask . . . . . . . . . . . : {mask:255.255.255.128}
       Default Gateway . . . . . . . . . : {gateway:172.16.173.1}
       IPv4 Address. . . . . . . . . . . : {ip*:172.16.173.106}
       Subnet Mask . . . . . . . . . . . : {mask:255.255.255.192}
       Default Gateway . . . . . . . . . : {gateway:172.16.173.1}
    '@
    
    ipconfig | ConvertFrom-String -TemplateContent $template | ft
    
    

You must be logged in to reply to this topic.