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
while ((Get-BitsTransfer | ? { $_.JobState -eq "Transferring" }).Count -gt 0) { | |
$totalbytes=0; | |
$bytestransferred=0; | |
$timeTaken = 0; | |
foreach ($job in (Get-BitsTransfer | ? { $_.JobState -eq "Transferring" } | Sort-Object CreationTime)) { | |
$totalbytes += $job.BytesTotal; | |
$bytestransferred += $job.bytestransferred | |
if ($timeTaken -eq 0) { | |
#Get the time of the oldest transfer aka the one that started first | |
$timeTaken = ((Get-Date) - $job.CreationTime).TotalMinutes |
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
# Originally published at https://gist.github.com/nzthiago/5736907 | |
# I Customized it for SPC14 with slides | |
# If you like it, leave me a comment | |
# If you don't like it, complain to Github. :) | |
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath | |
$rss = (new-object net.webclient) | |
# Grab the RSS feed for the MP4 downloads |
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
# From http://blogs.technet.com/b/heyscriptingguy/archive/2014/10/25/powertip-test-connectivity-to-remote-servers-without-ping.aspx | |
# Test a server for connectivity without PING | |
's1','s2' | % {Test-Wsman $_} |
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
Get-BitsTransfer | Select-Object -Property *,@{ Name = 'PercentComplete'; Expression = { '{0:P}' -f ($PSItem.BytesTransferred/$PSItem.BytesTotal); }; }; |
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 AWSPowerShell | |
Function Get-EC2LatestWindowsServerAMI | |
{ | |
return Get-EC2Image | ? { $_.Platform -eq "Windows" -and $_.ImageOwnerAlias -eq "amazon" -and $_.Name -like "*Windows*Server*2012*R2*English*Base*" } | Sort-Object -Property CreationDate -Descending | Select-Object -First 1 | |
} |
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
Get-EC2ImageByName windows_2012r2_base | Select-Object -First 1 |
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 azrdp { | |
<# | |
.Author | |
Trevor Sullivan <[email protected]> | |
.Description | |
Invoke a RDP session to an Azure Virtual Machine, without having to type the | |
Cloud Service name or Virtual Machine name. | |
.Outputs |
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
#!/bin/bash | |
# Encode a WAV to a finalized podcast MP3 with metadata, in the current directory | |
# Requires lame | |
# With Homebrew on Mac OS X: brew install lame | |
SHOW_AUTHOR="ATP" | |
EPISODE_NUMBER=104 | |
EPISODE_TITLE="Minutiæ" |
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
Show hidden characters
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme", | |
"draw_white_space": "selection", | |
"ensure_newline_at_eof_on_save": true, | |
"fade_fold_buttons": false, | |
"font_face": "Input Mono Narrow", | |
"font_size": 16, | |
"gutter": true, | |
"highlight_line": true, |