Skip to content

Instantly share code, notes, and snippets.

Ryan Ephgrave Ryan2065

Block or report user

Report or block Ryan2065

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Ryan2065 / WinPENanoDomainJoin.ps1
Created Oct 15, 2016
Nano domain join for use in SCCM task sequence!
View WinPENanoDomainJoin.ps1
$source = @'
using System;
using System.Security.Principal;
using System.Runtime.InteropServices;
namespace ECGCAT
public class Kernel32
[DllImport("Kernel32.dll", SetLastError = true)]
View Find Chess counts
Function Start-EphingThreads {
Param($ScriptBlock, $threads)
$SyncTable.ThreadsInProg = New-Object System.Collections.ArrayList
$Synctable.Runspaces = @{}
$SessionState = [System.Management.Automation.Runspaces.InitialSessionState]::CreateDefault()
$SessionState.ApartmentState = "STA"
$SessionState.Variables.Add((New-Object -TypeName System.Management.Automation.Runspaces.SessionStateVariableEntry -ArgumentList 'SyncTable', $SyncTable, ""))
$SyncTable.RunspacePool = [RunspaceFactory]::CreateRunspacePool(1, $Threads, $SessionState, $Host)
for ($i = 0; $i -lt $Threads; $i++) {
Ryan2065 / New-EphingWPFCode.ps1
Last active Jan 18, 2016
Create WPF code from XAML
View New-EphingWPFCode.ps1
Function New-EphingWPFCode {
Writes the code for a new WPF window in the ISE
The $xaml varialbe needs to be loaded in the session before this is run
Make sure to highlight the $xaml varialbe and run it!
Ryan2065 / MountDrive.ps1
Created Dec 22, 2015
Mount ephing drive
View MountDrive.ps1
Function Mount-EphingDrive {
Param ($Path)
$MountedDrive = Mount-VHD -Path $Path -ErrorAction SilentlyContinue -PassThru
$Drives = (Get-Partition -DiskNumber $MountedDrive.DiskNumber).DriveLetter
If ($Drives.Count -gt 1) {
$LargestDrive = 0
For ($d = 0; $d -lt $Drives.Count; $d++) {
If (($Drives[$d] -ne [char]0) -and ((Get-Partition -DriveLetter $Drives[$d]).Size -gt $LargestDrive)) {
$DriveLetter = $Drives[$d]
You can’t perform that action at this time.