PoshSec / PoshSecFramework

A framework for PowerShell and PoshSec scripts for network management, security, and maintenance.
BSD 3-Clause "New" or "Revised" License
145 stars 23 forks source link

Some scripts don't work on Win7 #4

Closed DBHeise closed 10 years ago

DBHeise commented 11 years ago

So I was testing out the project on my work machine (Win7 with PSv3) and it looks like some of the supplied scripts rely on some win8 functions (specifically it looks like monitorports.ps1 and many others rely on Get-NetIPAddress which is a function in the Win8 module NetTCPIP)...

We could wrap this with a test for that function (i.e. Test-Path function:Get-NetIPAddress) and then wrap either the C# function to get the IPAddresses, or wrap the output of ipconfig.

Not sure what path would be best.

Ben0xA commented 11 years ago

I run this on win7 x64 with psv3 and it works fine.

What is the error you are getting?

Ben0xA commented 11 years ago

Ah, I see. You're right. Get-NetIPAddress is for Win8. The reason that I didn't see an error was because it didn't show ipv6. That is in the Get-SecOpenPorts function. Great catch. We'll adjust that function appropriately.

Ben0xA commented 11 years ago

Again, great find and suggestion DBHeise.

Ben0xA commented 11 years ago

Staged in Development https://github.com/PoshSec/PoshSecFramework/commit/879dfa0555fd24c2a9ff0e2e7a96cbf9f7624532

Undergoing testing now.

rjcassara commented 11 years ago

Function seems to work in Win7 v3 and Win2008R2 v2 (although the other issues with v2 remain)