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-DNSDebugLog | |
{ | |
<# | |
.SYNOPSIS | |
This cmdlet parses a Windows DNS Debug log with details. | |
Author: @jarsnah12 | |
License: BSD 3-Clause | |
Required Dependencies: None | |
Optional Dependencies: None |
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
### Keybase proof | |
I hereby claim: | |
* I am mockmyberet on github. | |
* I am mockmyberet (https://keybase.io/mockmyberet) on keybase. | |
* I have a public key ASBqD2uwEW6LdFCe_NLIRZNW3ZttqRTSEjYzuyBC-MwurQo | |
To claim this, I am signing this object: |
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
#requires -version 5.0 | |
#requires -module PSReadline | |
Function Optimize-PSReadLineHistory { | |
<# | |
.SYNOPSIS | |
Optimize the PSReadline history file | |
.DESCRIPTION | |
The PSReadline module can maintain a persistent command-line history. However, there are no provisions for managing the file. When the file gets very large, performance starting PowerShell can be affected. This command will trim the history file to a specified length as well as removing any duplicate entries. |
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
Write-Verbose -Message 'Pull the encrypted password from our stored file' -Verbose | |
Unprotect-CmsMessage -Path .\password.cms | |
Write-Verbose -Message 'Do the same thing, but store it in a variable' -Verbose | |
$Password = Unprotect-CmsMessage -Path .\password.cms | ConvertTo-SecureString -AsPlainText -Force | |
Write-Verbose -Message 'Create a pscredential' -Verbose |
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
-----BEGIN NEW CERTIFICATE REQUEST----- | |
MIIDXTCCAkWgAwIBAgIQKo0vE+e1xZpLlUdypoNxgTANBgkqhkiG9w0BAQUFADAh | |
MR8wHQYDVQQDDBZ0b21teS5iZWNrZXJAZ21haWwuY29tMCAXDTE3MTAzMDA0MDAw | |
NloYDzMwMTcxMDMwMDQxMDA2WjAhMR8wHQYDVQQDDBZ0b21teS5iZWNrZXJAZ21h | |
aWwuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnwGh1MZVeOd9 | |
iffKmE3L1KvWsU6FJKb95cY3Yz3E1jb4VHYDJRGLZvcL19gxs3gahjDVUa75wVta | |
c39FjTCcu7ZH8s2XJ4PKH/ai3kHZLIjy9U2KdjA7ApuBDfmeoDLMJ23bAIR9l6kP | |
qLLAvwkVeZCy0ikEuPSkjos1f5WaNcwVF9krf77jHHMLhrbti1tAedimnDvcEJgf | |
6ArCAQa0lXsBrbih8tzwpDVaryFV2clzXDWa7grkpoOrVkxbtmB8DeKomUPAj4fJ | |
7gKJ604Ay+yQ1Wr9wZNd4nzBUKohISzGnVOoKkpnhVgxIPdXy2rD1b2RVNTHwu/G |
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-Excuse | |
{ | |
$url = 'http://pages.cs.wisc.edu/~ballard/bofh/bofhserver.pl' | |
$ProgressPreference = 'SilentlyContinue' | |
$page = Invoke-WebRequest -Uri $url -UseBasicParsing | |
$pattern = '<br><font size = "\+2">(.+)' | |
if ($page.Content -match $pattern) | |
{ | |
$matches[1] | |
} |
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
#requires -Version 2.0 -Modules Hyper-V | |
function New-VMFromScratch | |
{ | |
param | |
( | |
[String] | |
[Parameter(Mandatory,HelpMessage='Enter the name of the local VM.',ValueFromPipeline,ValueFromPipelineByPropertyName)] | |
$VMName | |
) | |
begin |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<Types> | |
<Type> | |
<Name>System.Net.IPAddress</Name> | |
<Members> | |
<ScriptProperty> | |
<Name>BigEndianAddress</Name> | |
<GetScriptBlock> | |
$bytes=$this.GetAddressBytes() | |
[array]::Reverse($bytes) |
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 ChooseFile( ) | |
Dim objFSO, objShell, objTempFolder, strTempFileName, strFullTempFileName, objOpenFile, objTextFile, strTempTextFileName | |
Const TemporaryFolder = 2 | |
Const ForReading = 1 | |
strTempFileName = "OpenFile.hta" | |
strTempTextFileName = "OpenFile.txt" | |
Set objFSO= CreateObject("Scripting.FileSystemObject") | |
Set objTempFolder = objFSO.GetSpecialFolder(TemporaryFolder) | |
strFullTempFileName=objTempFolder.Path & "\" & strTempFileName | |
Set objOpenFile = objFSO.CreateTextFile(strFullTempFileName,True) |