Skip to content

Instantly share code, notes, and snippets.

<#
.SYNOPSIS
BoxStarter script to configure Windows 10 development PC.
.DESCRIPTION
You might need to set:
Set-ExecutionPolicy RemoteSigned
Set-ExecutionPolicy Unrestricted
Set-ExecutionPolicy Bypass
@codekaizen
codekaizen / package-full.ps1
Created August 19, 2023 17:19 — forked from KZeronimo/package-full.ps1
Winget based Boxstarter Script - Full - Windows 10/11
# Set TLS 1.2
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
# Import Choco Install-*
Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force
# Set up choco cache location to work around Boxstarter Issue 241
$chocoCache = (Join-Path ([Environment]::GetEnvironmentVariable("LocalAppData")) "Temp\ChocoCache")
New-Item -Path $chocoCache -ItemType directory -Force
# Remove *.tmp from the choco cache directory so the ad-hoc package installs using Install-ChocolateyPackage behave idempotently - this is a hack
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@codekaizen
codekaizen / wttr.in for PowerShell
Created August 16, 2023 12:46 — forked from 9999years/wttr.in for PowerShell
How to enable wttr.in in a PowerShell console
<#
.DESCRIPTION
Fetches wttr.in for a terminal weather report.
.LINK
http://stknohg.hatenablog.jp/entry/2016/02/22/195644
.LINK
http://www.nivot.org/blog/post/2016/02/04/Windows-10-TH2-(v1511)-Console-Host-Enhancements
@codekaizen
codekaizen / git-notes.md
Created August 16, 2023 11:02 — forked from topheman/git-notes.md
Git notes cheat sheet
@codekaizen
codekaizen / TaskJob.cs
Created August 5, 2023 03:56 — forked from Stroniax/TaskJob.cs
A PowerShell Job wrapper for System.Threading.Tasks.Task to bridge the gap between asynchronous operations in C# and PowerShell.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.Threading;
using System.Threading.Tasks;
namespace Casion.PowerShell
{
/// <summary>
@codekaizen
codekaizen / CiscoVPNAutoLogin.ps1
Created August 2, 2023 07:36 — forked from fergie/CiscoVPNAutoLogin.ps1
PowerShell script to automate the Cisco AnyConnect SSL VPN client on Windows
# Source www.cze.cz
# This script is tested with "Cisco AnyConnect Secure Mobility Client version 3.0.5080"
# Run using %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\CiscoVPNAutoLogin.ps1"
# VPN connection details
[string]$CiscoVPNHost = "vpn.example.com"
[string]$Login = "username"
[string]$Password = "password"
[string]$vpncliAbsolutePath = 'C:\Program Files (x86)\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe'
Set-BoxStarterConfig -LocalRepo -NugetSources 'https://local/nuget//v3/index.json;https://community.chocolatey.org/api/v2/'
Install-Module -Name Microsoft.PowerShell.PSResourceGet -AllowPrerelease
Install-BoxstarterPackage PSDevMachine -DisableRestart
@codekaizen
codekaizen / packer.log
Last active November 17, 2017 20:13
Packer 1.1.2 VirtualBox Guest Additions resolution failure on Windows
2017/11/17 11:51:05 [INFO] Packer version: 1.1.2
2017/11/17 11:51:05 Packer Target OS/Arch: windows amd64
2017/11/17 11:51:05 Built with Go Version: go1.9
2017/11/17 11:51:05 [DEBUG] Discovered plugin: virtualbox-to-hyperv = C:\_dev\vms\packer_windows\packer-post-processor-virtualbox-to-hyperv.exe
2017/11/17 11:51:05 Using internal plugin for file
2017/11/17 11:51:05 Using internal plugin for hyperv-vmcx
2017/11/17 11:51:05 Using internal plugin for oracle-oci
2017/11/17 11:51:05 Using internal plugin for vmware-vmx
2017/11/17 11:51:05 Using internal plugin for profitbricks
2017/11/17 11:51:05 Using internal plugin for triton
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Reactive.Linq;
using System.Text;
using System.Threading;