This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-LACountyParcel { | |
<# | |
.EXAMPLE | |
Get-LACountyParcel -Parcel <id> | |
#> | |
[CmdletBinding()] | |
param( | |
$Parcel | |
) | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
some testing results: | |
machine1 | |
.\group-object-example.ps1 | |
PS 7.3.4 | |
Foreach: 0.0210048 | |
Group: 0.1844798 | |
.\group-object-example.ps1 | |
PS 5.1.22621.1778 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Example of how to get a list of updates that are available to install on a remote computer. | |
#> | |
$Scriptblock = { | |
# create a com object for the update session | |
$Session = New-Object -ComObject Microsoft.Update.Session | |
# create a search object for the update session | |
$Searcher = $Session.CreateupdateSearcher() | |
# search for updates that are assigned to the computer and not hidden and not installed. | |
# This can take some time to run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module PSParseHtml | |
function Search-Google { | |
<# | |
.SYNOPSIS | |
Search Google and return the first result(s) | |
.PARAMETER Query | |
The search query | |
.PARAMETER MaxResults | |
The maximum number of results to return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using namespace System.Globalization | |
# suppress all the errors from the conversion attempts. | |
$ErrorActionPreference = 'SilentlyContinue' | |
Remove-Variable fails, success, results, test* | |
# clean up old runs if run interactively. | |
filter Convert-DateTimeProperties { | |
$_.PSObject.Properties | ForEach-Object { | |
if ($_.Name -match 'date$|time$' -and $_.Value -is [string]) { | |
# these methods give almost the same results. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
// gcc print_argv.c -o print_argv | |
int main(int argc, char *argv[]) | |
{ | |
int i; | |
for(i = 1;i < argc;i++) | |
{ | |
printf("[%d] %s\n", i, argv[i]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Scan-LOLDrivers { | |
<# | |
.EXAMPLE | |
Scan-LOLDrivers -Path C:\Windows\System32\drivers | |
$Results = Scan-LOLDrivers -Path C:\Windows\inf | |
$Results | Select-Object * | |
$Results[0].all | |
$Results[0].all.KnownVulnerableSamples | |
.EXAMPLE | |
$iwantitall = 'C:\WINDOWS\inf', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Author: Jonathan Johnson (@jsecurity101) | |
function New-DriverConfig { | |
<# | |
.EXAMPLE | |
New-DriverConfig -Block | |
Creates driver block config in the current directory | |
.EXAMPLE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Show-Pipeline { | |
<# | |
.SYNOPSIS | |
Returns an object with the command and resolved command in a pipeline or input line. | |
@trackd | |
.PARAMETER Line | |
the line to parse | |
.EXAMPLE | |
$a = gci | % fullname | gi | Show-Pipeline -Verbose | |
$a | % fullname | gi | Show-Pipeline -Verbose -all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function table { | |
<# | |
format-table sugar that knows not to format if you're assigning to a variable. | |
it will automatically switch to Select-Object when assigned. | |
only implemented Property param atm, just testing it out for fun. | |
Set-Alias -Name ft -Value table -Force | |
to override default ft alias you need -Force. | |
#> | |
[CmdletBinding()] |
OlderNewer