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 $sourceFolder | % { gc $_.FullName | Set-Content (Join-Path $destFolder $_.Name) -Encoding Windows-1252 } |
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
.\age.exe -o document.pdf.age -r ageXXXXXXX .\document.pdf | |
.\age.exe -d -i age-identity.txt -o document.pdf .\document.pdf.age |
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
public static class Wcf | |
{ | |
private static WcfClient _server; | |
// Set via app.config | |
public static Uri Address | |
{ | |
get; set; | |
} |
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 Resolve-SPFRecord { | |
[CmdletBinding()] | |
param ( | |
# Domain Name | |
[Parameter(Mandatory = $true, | |
ValueFromPipeline = $true, | |
ValueFromPipelineByPropertyName = $true, | |
Position = 1)] | |
[string]$Name, |
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
.\bw.exe list items | ConvertFrom-Json | select name, revisiondate | sort revisiondate -desc | more |
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
rem Transcodes any audio track to AC3 while retaining video as-is. | |
rem Dedicated to the poor bastards with decoders not supporting the | |
rem ever more popular Dolby Digital Plus codec. | |
ffmpeg -i "INPUT" -map 0 -c:v copy -c:a ac3 -c:s copy "OUTPUT" |
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 Terminal-Icons | |
function prompt | |
{ | |
$identity = [Security.Principal.WindowsIdentity]::GetCurrent() | |
$principal = [Security.Principal.WindowsPrincipal] $identity | |
$adminRole = [Security.Principal.WindowsBuiltInRole]::Administrator | |
$ESC = [char]27 | |
$promptColor = $principal.IsInRole($adminRole) ? "$ESC[91m" : "$ESC[92m" |
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
# Downloads a list of URI's as specified by a given text file to the current directory. | |
# Usage: .\Downlink.ps1 -Path TextFile.txt | |
param( | |
[String]$path | |
) | |
Get-Content $path | ForEach-Object { | |
Write-Output $_ | |
Invoke-WebRequest -Uri $_ -OutFile $(Split-Path -Path "$_" -Leaf) |
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
/** | |
* @description Although Microsoft have improved this situation with Web API, | |
ASP .NET applications still return JSON dates in a proprietary | |
format similar to "/Date(1320825600000-0800)/". This function | |
parses these dates into a user locale depending date string. | |
* @param {string} s The ASP .NET date to parse and format. | |
* @returns {string} The formatted date. | |
*/ | |
aspNetDate: function (s) { | |
var dateParts = s.match(/\/Date\((\d+)[+-](\d+)\)\//); |
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 | |
Transfers files over HTTP or FTP. | |
.DESCRIPTION | |
Downloads or uploads files over HTTP or FTP. Supports user authentication and piped file names. | |
.PARAMETER UserName | |
The user account name or an anonymous connection if missing. | |
.PARAMETER Password | |
The user account password. | |
.PARAMETER FileName |