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
# | |
# Execute from the root of the repo. | |
# | |
$cargo_toml = Get-Content -Path ./imessage-exporter/Cargo.toml | |
$cargo_toml = $cargo_toml.Replace('version = "0.0.0"', "version = `"$version`"") | |
Out-File -FilePath ./imessage-exporter/Cargo.toml -InputObject $cargo_toml | |
$cargo_toml = Get-Content -Path ./imessage-database/Cargo.toml | |
$cargo_toml = $cargo_toml.Replace('version = "0.0.0"', "version = `"$version`"") | |
Out-File -FilePath ./imessage-database/Cargo.toml -InputObject $cargo_toml |
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
<# | |
.SYNOPSIS | |
Retrieve an icon from Gravatar | |
.DESCRIPTION | |
Retrieve an icon from Gravatar for the provided email address. | |
.EXAMPLE | |
PS C:\> Get-Gravatar -EmailAddress 'sally@example.com' | |
Requests an image from Gravatar for the email address 'sally@example.com' | |
If available, it will write a 300 pixel square image in the working dirctory | |
with the name sally@example.com.jpg |
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
# Get the bing image of the day. | |
$root_url = 'http://www.bing.com' | |
$dst_dir = Join-Path $HOME '/Documents/Pictures/deskFeed/' | |
if (!(Test-Path $dst_dir -PathType Container)) { | |
new-item -Path $dst_dir -ItemType Container | Out-Null | |
} | |
$validFileTypes = ("jpg","jpeg","png") | |
$targetRes = "1920x1080" # Retina MacBook Pro 2015 | |
[Int32]$numberOfImagesToFetch = 20 |
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 Search-FileIndex { | |
<# | |
.PARAMETER Path | |
Absoloute or relative path. Has to be in the Search Index for results to be presented. | |
.PARAMETER Pattern | |
File name or pattern to search for. Defaults to no values. Aliased to Filter to ergonomically match Get-ChildItem. | |
.PARAMETER Text | |
Free text to search for in the files defined by the pattern. | |
.PARAMETER Recurse | |
Add the parameter to perform a recursive search. Default is false. |
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
# Based on the format described at http://podcast411.com/howto_1.html | |
function createRssElement{ | |
param( | |
[string]$elementName, | |
[string]$value, | |
$parent | |
) | |
$thisNode = $rss.CreateElement($elementName) |
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
Get-EventLog -LogName System -newest 100 | where {$_.EventID -match '1001|1003'} | %{ $_.Message } | |
# or | |
Get-EventLog -LogName application -Newest 1000 | where {$_.EventID -match '1001|1003'} | select timewritten, message | % { | |
Write-Host "`n$('*'*80)" | |
Write-Host $_.message | |
) | |
# or |
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
# Scans the 192.168.1.nnn hosts for http responses. | |
for ($i = 1; $i -ile 254; $i++) { | |
$testAddress = "192.168.1." + $i | |
$info = Test-NetConnection -ComputerName $testAddress -CommonTCPPort http -InformationLevel Quiet | |
if ($info -eq $true) | |
{ | |
write-host "$testAddress is listening on 80 for HTTP traffic" | |
} | |
} |
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
# Current User | |
dir Cert:\CurrentUser\ -Recurse | where {(($_.Issuer -ne $null) -and ($_.Issuer.ToString() -match '.*Apple.*')) } | |
dir Cert:\CurrentUser\ -Recurse | where {(($_.Issuer -ne $null) -and ($_.Issuer.ToString() -match '.*Microsoft.*')) } | |
# Current Machine | |
dir Cert:\LocalMachine\ -Recurse | where {(($_.Issuer -ne $null) -and ($_.Issuer.ToString() -match '.*Apple.*')) } | |
dir Cert:\LocalMachine\ -Recurse | where {(($_.Issuer -ne $null) -and ($_.Issuer.ToString() -match '.*Microsoft.*')) } |
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 Microsoft.PowerShell.Security | |
set-location cert: | |
Get-ChildItem -recurse | Where-Object {$_.Thumbprint -match "98A04E4163357790C4A79E6D713FF0AF51FE6927"} | write-host "eDellRoot Found" |
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
gci . -recurse -filter *.ps* | % { | |
$MyFile = gc $_.Fullname -raw | |
$MyPath = $_.Fullname | |
[System.IO.File]::WriteAllLines($MyPath, $MyFile, [System.Text.UTF8Encoding]($False)) | |
} |
NewerOlder