This file contains 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 '[email protected]' | |
Requests an image from Gravatar for the email address '[email protected]' | |
If available, it will write a 300 pixel square image in the working dirctory | |
with the name [email protected] |
This file contains 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 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 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 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 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 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 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 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)) | |
} |
This file contains 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-WmiObject -Class Win32_OperatingSystem -Namespace "root\cimv2" | format-list Caption, Version |
NewerOlder