Skip to content

Instantly share code, notes, and snippets.

View johnkattenhorn's full-sized avatar

John Kattenhorn johnkattenhorn

View GitHub Profile
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTsConnections" -Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
(Get-WmiObject -class Win32_TSGeneralSetting -Namespace root\cimv2\terminalservices -Filter "TerminalName='RDP-tcp'").SetUserAuthenticationRequired(0)
Get-Disk | `
Where partitionstyle -eq 'raw' | `
Initialize-Disk -PartitionStyle MBR -PassThru | `
New-Partition -AssignDriveLetter -UseMaximumSize | `
Format-Volume -FileSystem NTFS -NewFileSystemLabel "datadisk" -Confirm:$false
# Boxstarter options
$Boxstarter.RebootOk=$false # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Install SQL Server 2014 Express and Tools (Neither seem to work with Boxstarter Remote)
#cinst -debug mssql2014express-defaultinstance
#cinst -debug MsSqlServerManagementStudio2014Express
@johnkattenhorn
johnkattenhorn / HostEnvironment.ps1
Created January 19, 2015 11:31
Boxstarter Script for Host Environment
function SetPowerPlan([string]$PreferredPlan)
{
Write-Host "Setting Powerplan to $PreferredPlan"
$guid = (Get-WmiObject -Class win32_powerplan -Namespace root\cimv2\power -Filter "ElementName='$PreferredPlan'").InstanceID.tostring()
$regex = [regex]"{(.*?)}$"
$newpowerVal = $regex.Match($guid).groups[1].value
# setting power setting to high performance
powercfg -S $newpowerVal
}
@johnkattenhorn
johnkattenhorn / DevEnvironment.ps1
Last active November 11, 2021 08:51
Boxstarter Script for VM-based Development Environment
function SetPowerPlan([string]$PreferredPlan)
{
Write-Host "Setting Powerplan to $PreferredPlan"
$guid = (Get-WmiObject -Class win32_powerplan -Namespace root\cimv2\power -Filter "ElementName='$PreferredPlan'").InstanceID.tostring()
$regex = [regex]"{(.*?)}$"
$newpowerVal = $regex.Match($guid).groups[1].value
# setting power setting to high performance
powercfg -S $newpowerVal
}
@johnkattenhorn
johnkattenhorn / HostDevEnvironment.ps1
Created January 19, 2015 11:20
HostDevEnvironment
function SetPowerPlan([string]$PreferredPlan)
{
Write-Host "Setting Powerplan to $PreferredPlan"
$guid = (Get-WmiObject -Class win32_powerplan -Namespace root\cimv2\power -Filter "ElementName='$PreferredPlan'").InstanceID.tostring()
$regex = [regex]"{(.*?)}$"
$newpowerVal = $regex.Match($guid).groups[1].value
# setting power setting to high performance
powercfg -S $newpowerVal
}