Skip to content

Instantly share code, notes, and snippets.

View khebbie's full-sized avatar

Klaus Hebsgaard khebbie

View GitHub Profile
@khebbie
khebbie / gitutils.ps1
Last active December 13, 2015 22:39 — forked from markembling/gitutils.ps1
# Git functions
# Mark Embling (http://www.markembling.info/)
# Is the current directory a git repository/working copy?
function isCurrentDirectoryGitRepository {
if ((Test-Path ".git") -eq $TRUE) {
return $TRUE
}
# Test within parent dirs
@khebbie
khebbie / downloadBuildVideos.ps1
Created November 6, 2012 08:50 — forked from erichexter/downloadBuildVideos.ps1
Download build 2012 videos
function downloadFile($url, $targetFile)
{
"Downloading $url"
$uri = New-Object "System.Uri" "$url"
$request = [System.Net.HttpWebRequest]::Create($uri)
$request.set_Timeout(15000) #15 second timeout
$response = $request.GetResponse()
$totalLength = [System.Math]::Floor($response.get_ContentLength()/1024)
$responseStream = $response.GetResponseStream()
$targetStream = New-Object -TypeName System.IO.FileStream -ArgumentList $targetFile, Create