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
%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat" & powershell" -new_console:d:D:\Dev | |
Admin: | |
%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat" & powershell" -new_console:a |
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
<# | |
Starts logging performance metrics on Windows using perfmon logging (logman). | |
A variety of metrics are collected to assist with diagnosing a performance bottleneck. | |
The metrics are logged to %systemdrive%\PerfLogs\Admin on a clean Windows install. | |
The script must be run with administrative credentials. | |
This script is intended for interactive execution. If you want to run it within an automated process, you'll need to check the exit code of logman.exe. The stop / delete steps are expected to fail if the job does not already exist. | |
I use the .blg file format to capture data because it can capture new processes that start during the capture. Because it is not possible to add new columns to the .csv, new processes that launch during the logging period cannot be added when logging to .csv. | |
The .blg file can be opened in Windows Performance Monitor (perfmon). | |
The perfmon .blg file can be converted into a .csv file by the following: |
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
#requires -version 3 | |
$ErrorActionPreference = 'Stop' | |
$networkTraceFileName = 'NetworkTrace' | |
function LaunchSingleRemoteCommand([string][parameter(mandatory)]$ComputerName, [pscredential]$Credential, [System.Management.Automation.Runspaces.AuthenticationMechanism]$Authentication, [scriptblock][parameter(mandatory)]$ScriptBlock) | |
{ | |
$args = @{ | |
ComputerName = $ComputerName |
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
(New-Object Security.Principal.WindowsPrincipal ([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) |
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
using RDotNet; | |
/* | |
d:/temp/plot.r: | |
suppressPackageStartupMessages(library(ggplot2)) | |
library(ggplot2) | |
p <- qplot(Sepal.Length, Petal.Length, data = iris, color = Species) | |
png(filename=fileName, width=500, height=500) |
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
iislog <- read.delim("Filtered.log", header=TRUE, sep=" ") | |
iislog <- within(v, { localdatetime=as.POSIXct(paste(date, time)) + 13*60*60 }) | |
h <- hist( | |
iislog$localdatetime, | |
freq = TRUE, | |
breaks=24, | |
xlab = "Time of day", | |
ylab = "Requests per hour", | |
axes = F, |
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
#requires -modules sqlps | |
#requires -version 3 | |
param([string]$ServerToQuery = ([Environment]::MachineName), [PSCredential]$SqlCredential) | |
$ErrorActionPreference = 'Stop' | |
pushd | |
ipmo sqlps -DisableNameChecking | |
popd |
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 Add-TabExpansion | |
{ | |
param([ScriptBlock][parameter(mandatory)]$ScriptBlock) | |
$originalFunction = (gcm TabExpansion2).ScriptBlock | |
$chainedBlock = { | |
$userResult = & $ScriptBlock @Args | |
if($userResult) { | |
return $userResult | |
} |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] | |
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,5d,e0,5c,e0,37,00,46,00,\ | |
00,00,00,00 |
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
$ErrorActionPreference = 'Stop' | |
$filesToIgnore = git status | ? { $_.StartsWith("`t") } | % { $_.SubString(1) } | ? { !$_.StartsWith("deleted:") } | |
$filesToIgnore | % { | |
$fileName = [IO.Path]::GetFileName($_) | |
$directory = [IO.Path]::GetDirectoryName($_) | |
if($fileName.length -eq 0) { | |
#The path is actually a directory | |
$fileName = [IO.Path]::GetFileName($directory) + "/" | |
$directory = [IO.Path]::GetDirectoryName($directory) |