Posh-Shodan icon indicating copy to clipboard operation
Posh-Shodan copied to clipboard

Add some sample scripts

Open ahhh opened this issue 10 years ago • 6 comments

Add some sample scripts / templates for programmatically using the wrapper

ahhh avatar Nov 29 '15 22:11 ahhh

Any update on merging this branch @darkoperator ?

ahhh avatar Feb 17 '16 01:02 ahhh

Can you make them follow https://github.com/PoshCode/PowerShellPracticeAndStyle the use of echo is just ugly in a PS script, also make sure it follows the same indentation, brace and other styles of the module it self. Thanks you for the effort and work. looking forward to merging it once they are modified.

On Feb 16, 2016, at 9:13 PM, ahhh [email protected] wrote:

Any update on merging this branch @darkoperator https://github.com/darkoperator ?

— Reply to this email directly or view it on GitHub https://github.com/darkoperator/Posh-Shodan/pull/2#issuecomment-184960347.

darkoperator avatar Feb 17 '16 02:02 darkoperator

@darkoperator Thank you for the feedback, please see edits

ahhh avatar Feb 18 '16 02:02 ahhh

Any update?

ahhh avatar Mar 29 '16 16:03 ahhh

I have not taken a look, will do today.

On Mar 29, 2016, at 12:51 PM, ahhh [email protected] wrote:

Any update?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/darkoperator/Posh-Shodan/pull/2#issuecomment-202994994

darkoperator avatar Mar 29 '16 16:03 darkoperator

One more set of recommendations, instead of write-host each property

-        Write-Output "IP: $($result.ip_str)"
-        Write-Output "Port: $($result.port)"
-        Write-Output "Domain: $($result.domains)"  
-        Write-Output "Organization: $($result.org)"
-        Write-Output "Location $($result.location)"
-        Write-Output "Time: $($result.timestamp)"
-        Write-Output "Product $($result.product)"
-        Write-Output "Protocol $($result.transport)"
-        Write-Output "Shodan Method Used: $($result._shodan)"
-        Write-Output "Data: $($result.data)"
-        Write-Output ""
-    }

better to output and object, since it is PSv3 and above you can create an ordered hash table ([ordered]@{}) out each property as a member of the hash table and then do new-object -typename psobject -properties that way you return an object. that can then be manipulated.

on the relative path better to use $psscriptroot\file than .\file

darkoperator avatar Mar 29 '16 22:03 darkoperator