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-Deck { | |
| param([int]$decks=1) | |
| $return = Invoke-WebRequest -Uri "http://deckofcardsapi.com/api/deck/new/shuffle/?deck_count=$decks" | |
| if ($return.StatusCode -eq 200) {return $return.Content | ConvertFrom-Json} | |
| else {break $return.StatusCode} | |
| } | |
| function Get-Cards { | |
| param( | |
| [Parameter(ValueFromPipelineByPropertyName,Mandatory)] |
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-StarCitizenManifest { | |
| [CmdletBinding(SupportsShouldProcess)] | |
| param() | |
| $return = Invoke-WebRequest -Uri 'http://manifest.robertsspaceindustries.com/Launcher/_LauncherInfo' -OutFile $env:temp/launcherInfo | |
| Get-Content -Path $env:temp/launcherInfo | ConvertFrom-StringData | |
| } | |
| function Get-StarCitizenFiles { | |
| [CmdletBinding(SupportsShouldProcess)] | |
| param( |
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 sys, re | |
| from datetime import datetime | |
| if sys.argv[1].lower().endswith(".qif"): | |
| redate = re.compile("D\d{2}\/\D{3}\/\d{4}") | |
| with open(sys.argv[1], "r") as infile: | |
| print("Now reading "+infile.name+"...") | |
| with open(sys.argv[1][:-4]+"_converted.qif", 'w') as outfile: |
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 | |
| Begins an Azure DirSync. | |
| .Description | |
| Contains a function that will connect to a server (defaulting to ADFS01), load the Azure DirSync profile, and kick off a sync. | |
| Prompts for creds regardless of account, but can be given credentials to use. | |
| .Parameter server | |
| The server to connect to. Defaults to ADFS01. | |
| .Parameter Credential | |
| Credentials to try connecting to the server with. |
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
| #! /bin/bash | |
| CURRENT=$(df / | grep / | awk '{ print $5 }' | sed 's/%//g') | |
| THRESHOLD=90 | |
| LOGFILE=~/Scripts/DiskReport.log | |
| echo "Last Run: $(date "+%d%m%Y %T") : $CURRENT% Used." > $LOGFILE | |
| if [ "$CURRENT" -gt "$THRESHOLD" ] ; then | |
| ssmtp -s 'Disk Space Alert' helpdesk@domain.tld << EOF | |
| Root partition remaining free space is critically low. Used: $CURRENT% |
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 Export-HashTable { | |
| param( | |
| [Parameter(Mandatory, ValueFromPipeline)] | |
| [Alias('InputObject')] | |
| [PSObject]$HashTable, | |
| [String]$Path, | |
| [String]$Name | |
| ) | |
| process { | |
| $divWidth = ($HashTable.Keys.Length | Measure-Object -Maximum).Maximum + 8 |
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-SysInternalsTools { | |
| [CmdletBinding(DefaultParameterSetName='Update')] | |
| param( | |
| [Parameter(Mandatory)] | |
| $localDirectory, | |
| [Parameter(ParameterSetName='Download')] | |
| [Switch]$DownloadAll | |
| ) | |
| begin { | |
| $localTools = Get-ChildItem $localDirectory -Filter *.exe |
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 ConvertTo-OTBStyle { | |
| #Requires -Modules @{ModuleName='PSScriptAnalyzer';ModuleVersion='1.15.0'} | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory, ParameterSetName = 'Directory')] | |
| [ValidateScript( {Test-Path -Path $_ -PathType Container})] | |
| [IO.DirectoryInfo]$Directory, | |
| [Parameter(ParameterSetName = 'Directory')] | |
| [Switch]$Recurse, |
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 Update-LocalTFSFolder { | |
| [CmdletBinding()] | |
| param( | |
| [ValidateScript({Test-Path $_ -Include "tf.exe" -Type Leaf})] | |
| $TF = "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TF.exe", | |
| [Parameter(ValueFromPipeline,Mandatory,ParameterSetName='Path')] | |
| [String]$Path, | |
| [Parameter(ValueFromPipelineByPropertyName,Mandatory,ParameterSetName='FullName')] |
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
| #CommentFlag // | |
| #InstallKeybdHook | |
| // Author: Jarvis Prestidge | |
| // Description: Simulates my preferred keyboard layout, similiar to that of the Pok3r 60% keyboard | |
| // on any keyboard without programmable keys. i.e. my laptop ^^ | |
| // <COMPILER: v1.1.22.00> | |
OlderNewer