Skip to content

Instantly share code, notes, and snippets.

View MSAdministrator's full-sized avatar
💭
Building Thangs

Josh Rickard MSAdministrator

💭
Building Thangs
View GitHub Profile
@MSAdministrator
MSAdministrator / Get-MyGeoLocation
Created August 25, 2015 04:00
2015-August Scripting Games Puzzle - Get-MyGeoLocation
function Get-MyGeoLocation {
param (
[parameter(HelpMessage="Please provide a save location")]
[string]$outfilepath = $("C:\users\{0}\Desktop\map.html" -f $($env:username))
)
<#
.SYNOPSIS
Map your current location on google maps
.DESCRIPTION
@MSAdministrator
MSAdministrator / QualysNotificationData.ps1
Created September 14, 2015 22:21
Get-QualysNotificationData
function Get-NotificationData {
[cmdletbinding()]
param (
[parameter(Mandatory=$true,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
HelpMessage="Please enter a QID (Qualys ID) to search for")]
[ValidateCount(1,20)]
[ValidateNotNullOrEmpty()]
[string[]]$QID,
@MSAdministrator
MSAdministrator / gist:69bb4d19242c379904ca
Created November 12, 2015 14:40
Get-QualysNotificationData
#requires -Version 2
function Get-NotificationData
{
[cmdletbinding()]
param (
[parameter(Mandatory = $true,
ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true,
HelpMessage = 'Please enter a QID (Qualys ID) to search for')]
[ValidateCount(1,20)]
@MSAdministrator
MSAdministrator / gist:6726071d05a3673bed9e
Created November 12, 2015 14:41
Get-QualysBusinessUnitInformation
#requires -Version 3
<#
.Synopsis
This function gets Business Unit information
.DESCRIPTION
This function is primarily called from the Get-NofiticationData function to gather busines unit information.
Once we have this information it used to begin processing notification emails
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
@MSAdministrator
MSAdministrator / gist:a8fa329c9d22508b5b20
Created November 12, 2015 14:45
Get-QualysAssetGroupInformation
#requires -Version 3
<#
.Synopsis
This function gets Business Unit information
.DESCRIPTION
This function is primarily called from the Get-NofiticationData function to gather busines unit information.
Once we have this information it used to begin processing notification emails
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
function Test-QualysAuthentication ()
{
[cmdletbinding()]
param (
[parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
HelpMessage="Please provide a credential obejct")]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.CredentialAttribute()]$credential
@MSAdministrator
MSAdministrator / Search-VTForHash
Created March 11, 2016 03:59
This is a sample of checking VT for hashes using PowerShell. Check out PPRT (PowerShell Phishing Response Toolkit) for a more accurate use. https://github.com/MSAdministrator/PPRT---PowerShell-Phishing-Response-Toolkit
#Get-FileHash is a built in PowerShell cmdlet with Version 5
Write-Verbose "Downloading Posh-VirusTotal PowerShell Module...."
iex (New-Object Net.WebClient).DownloadString("https://gist.githubusercontent.com/darkoperator/9138373/raw/22fb97c07a21139a398c2a3d6ca7e3e710e476bc/PoshVTInstall.ps1")
$VTAPIkey = 'somevtapikey'
#single file Hash
$AttachmentHash = Get-FileHash C:\$env:Desktop\somefile.txt
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
<!--
Copy from: Abhishek's PowerShell Blog - http://abhishek225.spaces.live.com/blog/
Original post: http://abhishek225.spaces.live.com/blog/cns!13469C7B7CE6E911!165.entry
-->
<Types>
<Type>
<Name>System.__ComObject</Name>
<Members>
<ScriptMethod>
@MSAdministrator
MSAdministrator / Update-MSITableSettings
Created May 21, 2016 04:15
Update-MSITableSettings
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>