I hereby claim:
- I am jamessantiago on github.
- I am jamessantiago (https://keybase.io/jamessantiago) on keybase.
- I have a public key whose fingerprint is 2D51 FA1E 42DE AF48 33FC 021D BAF3 C497 EC8C F91C
To claim this, I am signing this object:
Import-Module BitsTransfer | |
$s = "C:\Source" | |
$d = "D:\Destination" | |
xcopy.exe /T /E $s $d | |
ls $s -Recurse |? {! $_.PSIsContainer} |% { | |
$e = $_.FullName.Remove(0, $s.Length + 1) | |
start-bitstransfer $($_.FullName) $d\$e | |
} |
$a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
$ToTest = { | |
"AAAAAAA" | |
"AAAAAAAA" | |
"AAAAAAAAA" | |
"AAAAAAAAAA" | |
"AAAAAAAAAAA" | |
"AAAAAAAAAAAA" | |
"AAAAAAAAAAAAA" |
#you can use this as a script or just run these three commands one at a time | |
import-module bitstransfer | |
#kick off the transfer | |
start-bitstransfer -source "large file" -destination "folder" -asyncronous -displayname MyTransfer | |
#monitor transfer and restart if failed | |
1..1000|% {sleep (60); get-bitstransfer -name MyTransfer |% {if ($_.jobstate -eq "Transferring") {write-host $($_.bytestransfered / $_.bytestotal)} elseif ($_.jobstate -like "error") {resume-bitstransfer $_; "resuming after error"} elseif ($_.jobstate -like "Transferred") {complete-bitstransfer $_; exit}} |
$logs = 'c:\windows\system32\ccm\logs\smstslog' | |
if (-not (test-path $logs)) | |
{ | |
exit 0 | |
} | |
$tsenv = new-object -comobject Microsoft.SMS.TSEnvironment | |
$computer = "" | |
if ($tsenv -ne $null) | |
{ |
//Notes: | |
//Requires the MMBot.Powershell nuget package | |
//Output objects must either support a ToString method or be a string to display properly | |
//It is recommended to use the PowershellModule script instead of this one to control what is executed | |
using MMBot.Powershell; | |
var robot = Require<Robot>(); | |
robot.Respond(@"(ps|powershell) (.*)", msg => |
//Notes: | |
//Requires the MMBot.Powershell nuget package | |
//Specify the powershell scripts folder using the MMBOT_POWERSHELL_SCRIPTSPATH key in the ini file | |
//Powershell scripts must be .psm1 (modules) to be executed | |
//Only scripts inside the scripts folder may be executed using this script | |
//Output objects must either support a ToString method or be a string to display properly | |
using MMBot.Powershell; | |
var robot = Require<Robot>(); |
function Get-DiskUsage { | |
<# | |
.SYNOPSIS | |
Gives details on disk free space | |
.DESCRIPTION | |
Returns a list of drives on the local machine | |
.NOTES | |
Name: Get-DiskUsage | |
Author: James Santiago | |
DateCreated: 08/21/2013 |
Add-Type @" | |
using System; | |
using System.Runtime.InteropServices; | |
public class Tricks { | |
[DllImport("user32.dll")] | |
public static extern IntPtr GetForegroundWindow(); | |
} | |
"@ | |
1..60 |% { |
I hereby claim:
To claim this, I am signing this object:
[reflection.assembly]::LoadWithPartialName("System.Drawing") | Out-Null | |
#1920x1200 is the starting image, doesn't have to be this resolution | |
$baseImage = New-Object system.drawing.bitmap $pwd\1920x1200.jpg | |
$files = @" | |
Background1024x1280.jpg | |
Background1024x1280.jpg | |
Background1024x768.jpg | |
Background1280x1024.jpg |